Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-09-18 09:10:07 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-09-18 09:15:06 +0300
commitd421adb83e8d39bd9d74ea3d526326b70e93c341 (patch)
tree4c5e16b5e2fcd8c587204aa85dde175a6951392a /source/blender/editors/mesh/editmesh_add_gizmo.c
parent0a3b66cfb573a91ba3b19f30ead4a026bdfa6873 (diff)
Gizmo: de-duplicate poll logic
Checking the active tool or operator was a common way to check if the gizmo was still in use.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_add_gizmo.c')
-rw-r--r--source/blender/editors/mesh/editmesh_add_gizmo.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/editors/mesh/editmesh_add_gizmo.c b/source/blender/editors/mesh/editmesh_add_gizmo.c
index 38fc7d58dcf..d56d9513fc8 100644
--- a/source/blender/editors/mesh/editmesh_add_gizmo.c
+++ b/source/blender/editors/mesh/editmesh_add_gizmo.c
@@ -35,6 +35,7 @@
#include "BKE_editmesh.h"
#include "ED_gizmo_library.h"
+#include "ED_gizmo_utils.h"
#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_screen.h"
@@ -199,12 +200,7 @@ static void gizmo_placement_prop_matrix_set(
static bool gizmo_mesh_placement_poll(const bContext *C, wmGizmoGroupType *gzgt)
{
- wmOperator *op = WM_operator_last_redo(C);
- if (op == NULL || !STREQ(op->type->idname, "MESH_OT_primitive_cube_add_gizmo")) {
- WM_gizmo_group_type_unlink_delayed_ptr(gzgt);
- return false;
- }
- return true;
+ return ED_gizmo_poll_or_unlink_delayed_from_operator(C, gzgt, "MESH_OT_primitive_cube_add_gizmo");
}
static void gizmo_mesh_placement_modal_from_setup(