diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-11-18 20:19:59 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-11-18 20:19:59 +0300 |
commit | f190f2d267df46d25d74009a3c14ac10753d57ca (patch) | |
tree | 1027d79363821162f50ef4948552119f7491c738 /source/blender/editors/transform/transform_convert_node.c | |
parent | 0c33411bddfd3e2ab85dbf8411334f18fdaeb460 (diff) |
Revert fixes
Diffstat (limited to 'source/blender/editors/transform/transform_convert_node.c')
-rw-r--r-- | source/blender/editors/transform/transform_convert_node.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/transform/transform_convert_node.c b/source/blender/editors/transform/transform_convert_node.c index 10c0ee48749..da11666d445 100644 --- a/source/blender/editors/transform/transform_convert_node.c +++ b/source/blender/editors/transform/transform_convert_node.c @@ -164,7 +164,6 @@ void createTransNodeData(TransInfo *t) void flushTransNodes(TransInfo *t) { const float dpi_fac = UI_DPI_FAC; - float offset[2] = {0.0f, 0.0f}; View2DEdgePanData *customdata = (View2DEdgePanData *)t->custom.type.data; @@ -178,16 +177,14 @@ void flushTransNodes(TransInfo *t) t->region->winrct.xmin + t->mval[0], t->region->winrct.ymin + t->mval[1], }; - const rctf rect = t->region->v2d.cur; UI_view2d_edge_pan_apply(t->context, customdata, xy); - if (!BLI_rctf_compare(&rect, &t->region->v2d.cur, FLT_EPSILON)) { - /* Additional offset due to change in view2D rect. */ - BLI_rctf_transform_pt_v(&t->region->v2d.cur, &rect, offset, offset); - t->flag |= T_VIEW_DIRTY; - } } } + /* Initial and current view2D rects for additional transform due to view panning and zooming */ + const rctf *rect_src = &customdata->initial_rect; + const rctf *rect_dst = &t->region->v2d.cur; + FOREACH_TRANS_DATA_CONTAINER (t, tc) { applyGridAbsolute(t); @@ -198,7 +195,10 @@ void flushTransNodes(TransInfo *t) bNode *node = td->extra; float loc[2]; - add_v2_v2v2(loc, td2d->loc, offset); + copy_v2_v2(loc, td2d->loc); + + /* additional offset due to change in view2D rect */ + BLI_rctf_transform_pt_v(rect_dst, rect_src, loc, loc); #ifdef USE_NODE_CENTER loc[0] -= 0.5f * BLI_rctf_size_x(&node->totr); |