Fix manipulator handles getting added each refresh
authorCampbell Barton <ideasman42@gmail.com>
Fri, 21 Jul 2017 15:25:45 +0000 (01:25 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 21 Jul 2017 15:57:23 +0000 (01:57 +1000)
The same manipulator map handler would accumulate,
slowing down interactions.

source/blender/editors/space_image/space_image.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_view3d/space_view3d.c

index 58fb75edd84f2321cb7990517ebc6e2bd0006c95..648c1b301e3872a54496c45286ef9417c53f4d64 100644 (file)
@@ -680,8 +680,9 @@ static void image_main_region_init(wmWindowManager *wm, ARegion *ar)
                        .regionid = RGN_TYPE_WINDOW,
                };
                ar->manipulator_map = WM_manipulatormap_new_from_type(&wmap_params);
+
+               WM_manipulatormap_add_handlers(ar, ar->manipulator_map);
        }
-       WM_manipulatormap_add_handlers(ar, ar->manipulator_map);
 
        /* mask polls mode */
        keymap = WM_keymap_find(wm->defaultconf, "Mask Editing", 0, 0);
index c1099f38d925708d024831d6affb93500ac8e57e..c070495e565eeeeafa3b14a430517c9556bd5e81 100644 (file)
@@ -649,9 +649,9 @@ static void node_main_region_init(wmWindowManager *wm, ARegion *ar)
        if (ar->manipulator_map == NULL) {
                ar->manipulator_map = WM_manipulatormap_new_from_type(
                        &(const struct wmManipulatorMapType_Params){SPACE_NODE, RGN_TYPE_WINDOW});
-       }
 
-       WM_manipulatormap_add_handlers(ar, ar->manipulator_map);
+               WM_manipulatormap_add_handlers(ar, ar->manipulator_map);
+       }
 
        /* own keymaps */
        keymap = WM_keymap_find(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
index 8bb3806a0701a54dca6477b00476f669fc1b4e38..5dc802df871de16bab7585a06da8481936306b30 100644 (file)
@@ -494,9 +494,9 @@ static void view3d_main_region_init(wmWindowManager *wm, ARegion *ar)
        if (ar->manipulator_map == NULL) {
                ar->manipulator_map = WM_manipulatormap_new_from_type(
                        &(const struct wmManipulatorMapType_Params) {SPACE_VIEW3D, RGN_TYPE_WINDOW});
-       }
 
-       WM_manipulatormap_add_handlers(ar, ar->manipulator_map);
+               WM_manipulatormap_add_handlers(ar, ar->manipulator_map);
+       }
 
        /* object ops. */