diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2020-02-27 22:42:34 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-02-27 22:42:43 +0300 |
commit | 91abb70006866e651233ff44f0f275856a6bf65d (patch) | |
tree | 18b08c7bb03f334a97f53df639ea2dcc8f06925d /source/blender/editors/transform/transform_convert.c | |
parent | c20caec7f0b39b7d15bd600880ea9534c31f6732 (diff) |
Transform: Remove 'mouse_coordinate_override' property
This property depends on the view that can change when redoing.
Diffstat (limited to 'source/blender/editors/transform/transform_convert.c')
-rw-r--r-- | source/blender/editors/transform/transform_convert.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_convert.c b/source/blender/editors/transform/transform_convert.c index 027ae04795a..78e785e0e71 100644 --- a/source/blender/editors/transform/transform_convert.c +++ b/source/blender/editors/transform/transform_convert.c @@ -69,6 +69,8 @@ #include "ED_clip.h" #include "ED_mask.h" +#include "UI_view2d.h" + #include "WM_api.h" /* for WM_event_add_notifier to deal with stabilization nodes */ #include "WM_types.h" @@ -787,6 +789,19 @@ void clipUVData(TransInfo *t) /* ********************* ANIMATION EDITORS (GENERAL) ************************* */ +/* In modal, `t->center_global` may not have been inited yet. */ +void transform_convert_center_global_v2(TransInfo *t, float r_center[2]) +{ + /* In modal, `t->center2d` may not have been inited yet. */ + if (t->flag & T_MODAL) { + UI_view2d_region_to_view( + (View2D *)t->view, t->mouse.imval[0], t->mouse.imval[1], &r_center[0], &r_center[1]); + } + else { + copy_v2_v2(r_center, t->center_global); + } +} + /* This function tests if a point is on the "mouse" side of the cursor/frame-marking */ bool FrameOnMouseSide(char side, float frame, float cframe) { |