fix for error loading ruler info back from greasepencil.
This commit is contained in:
@@ -368,7 +368,7 @@ static bool view3d_ruler_from_gpencil(bContext *C, RulerInfo *ruler_info)
|
||||
}
|
||||
else if (gps->totpoints == 2) {
|
||||
RulerItem *ruler_item = ruler_item_add(ruler_info);
|
||||
for (j = 0; j < 3; j++) {
|
||||
for (j = 0; j < 3; j += 2) {
|
||||
copy_v3_v3(ruler_item->co[j], &pt->x);
|
||||
pt++;
|
||||
}
|
||||
@@ -732,7 +732,8 @@ static int view3d_ruler_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
op->customdata = ruler_info;
|
||||
|
||||
ruler_info->ar = ar;
|
||||
ruler_info->draw_handle_pixel = ED_region_draw_cb_activate(ar->type, ruler_info_draw_pixel, ruler_info, REGION_DRAW_POST_PIXEL);
|
||||
ruler_info->draw_handle_pixel = ED_region_draw_cb_activate(ar->type, ruler_info_draw_pixel,
|
||||
ruler_info, REGION_DRAW_POST_PIXEL);
|
||||
|
||||
view3d_ruler_header_update(sa);
|
||||
|
||||
@@ -794,7 +795,6 @@ static int view3d_ruler_modal(bContext *C, wmOperator *op, wmEvent *event)
|
||||
|
||||
negate_v3_v3(ruler_item->co[0], rv3d->ofs);
|
||||
view3d_ruler_item_project(ruler_info, ruler_item->co[0], event->mval);
|
||||
copy_v3_v3(ruler_item->co[2], ruler_item->co[0]);
|
||||
|
||||
/* snap the first point added, not essential but handy */
|
||||
{
|
||||
@@ -802,6 +802,7 @@ static int view3d_ruler_modal(bContext *C, wmOperator *op, wmEvent *event)
|
||||
view3d_ruler_item_mousemove(C, ruler_info, event->mval, true);
|
||||
}
|
||||
|
||||
copy_v3_v3(ruler_item->co[2], ruler_item->co[0]);
|
||||
ruler_item->co_index = 2;
|
||||
|
||||
do_draw = true;
|
||||
|
Reference in New Issue
Block a user