diff options
author | Ines Almeida <britalmeida@gmail.com> | 2018-04-23 01:42:17 +0300 |
---|---|---|
committer | Ines Almeida <britalmeida@gmail.com> | 2018-04-23 01:59:01 +0300 |
commit | 574c0fe38f332bd97c588029c0075ecba1fe19cd (patch) | |
tree | 9c234ba62e515d24334fa06aa7f97b0d1d0a8e33 /source/blender/editors/transform/transform_input.c | |
parent | 93adbf8195f0960fc203e8d1a3851efd38526d21 (diff) |
Manipulators/Tools: always draw a cursor while interacting
Cursor can be a system one or drawn with OpenGL.
Before, dragging the transform manipulator would hide the cursor and reset it to the initial positon.
Diffstat (limited to 'source/blender/editors/transform/transform_input.c')
-rw-r--r-- | source/blender/editors/transform/transform_input.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 5f2e5a99090..df77b6129a7 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -30,10 +30,13 @@ #include "DNA_screen_types.h" +#include "BKE_context.h" + #include "BLI_math.h" #include "BLI_utildefines.h" #include "WM_types.h" +#include "WM_api.h" #include "transform.h" @@ -341,6 +344,25 @@ void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode) break; } + /* setup for the mouse cursor: either set a custom one, + * or hide it if it will be drawn with the helpline */ + wmWindow *win = CTX_wm_window(t->context); + switch(t->helpline) { + case HLP_NONE: + /* INPUT_VECTOR, INPUT_CUSTOM_RATIO, INPUT_CUSTOM_RATIO_FLIP */ + WM_cursor_set(win, BC_HANDCURSOR); + break; + case HLP_SPRING: + case HLP_ANGLE: + case HLP_TRACKBALL: + case HLP_HARROW: + case HLP_VARROW: + WM_cursor_set(win, CURSOR_NONE); + break; + default: + break; + } + /* if we've allocated new data, free the old data * less hassle then checking before every alloc above */ if (mi_data_prev && (mi_data_prev != mi->data)) { |