Fix T67472: Gizmo overlap causes cursor to get stuck
authorCampbell Barton <ideasman42@gmail.com>
Thu, 25 Jul 2019 00:53:04 +0000 (10:53 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 25 Jul 2019 00:53:04 +0000 (10:53 +1000)
source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c

index 534474a6221ac97859a23deec40a01e00e899206..ee96515c27f0cf5339557e431c206fde1a5e3c77 100644 (file)
@@ -973,7 +973,8 @@ bool WM_gizmomap_cursor_set(const wmGizmoMap *gzmap, wmWindow *win)
 bool wm_gizmomap_highlight_set(wmGizmoMap *gzmap, const bContext *C, wmGizmo *gz, int part)
 {
   if ((gz != gzmap->gzmap_context.highlight) || (gz && part != gz->highlight_part)) {
-    const bool init_last_cursor = (gzmap->gzmap_context.highlight == NULL);
+    const bool init_last_cursor = !(gzmap->gzmap_context.highlight &&
+                                    gzmap->gzmap_context.last_cursor != -1);
     if (gzmap->gzmap_context.highlight) {
       gzmap->gzmap_context.highlight->state &= ~WM_GIZMO_STATE_HIGHLIGHT;
       gzmap->gzmap_context.highlight->highlight_part = -1;