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:
Diffstat (limited to 'source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c')
-rw-r--r--source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c
index 800e679b8a9..bba5be4ba7d 100644
--- a/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c
+++ b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c
@@ -32,6 +32,7 @@
#include "WM_types.h"
#include "WM_message.h"
+#include "ED_gizmo_utils.h"
#include "ED_screen.h"
#include "ED_view3d.h"
@@ -67,20 +68,6 @@ typedef struct GizmoGroupData_SpinInit {
} data;
} GizmoGroupData_SpinInit;
-static bool gizmo_mesh_spin_init_poll(const bContext *C, wmGizmoGroupType *gzgt)
-{
- ScrArea *sa = CTX_wm_area(C);
- bToolRef_Runtime *tref_rt = sa->runtime.tool ? sa->runtime.tool->runtime : NULL;
- if ((tref_rt == NULL) ||
- !STREQ(gzgt->idname, tref_rt->gizmo_group) ||
- !ED_operator_editmesh_view3d((bContext *)C))
- {
- WM_gizmo_group_type_unlink_delayed_ptr(gzgt);
- return false;
- }
- return true;
-}
-
static void gizmo_mesh_spin_init_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
{
/* alpha values for normal/highlighted states */
@@ -241,7 +228,7 @@ void MESH_GGT_spin(struct wmGizmoGroupType *gzgt)
gzgt->gzmap_params.spaceid = SPACE_VIEW3D;
gzgt->gzmap_params.regionid = RGN_TYPE_WINDOW;
- gzgt->poll = gizmo_mesh_spin_init_poll;
+ gzgt->poll = ED_gizmo_poll_or_unlink_delayed_from_tool;
gzgt->setup = gizmo_mesh_spin_init_setup;
gzgt->refresh = gizmo_mesh_spin_init_refresh;
gzgt->message_subscribe = gizmo_mesh_spin_init_message_subscribe;
@@ -506,12 +493,7 @@ static void gizmo_spin_prop_angle_set(
static bool gizmo_mesh_spin_redo_poll(const bContext *C, wmGizmoGroupType *gzgt)
{
- wmOperator *op = WM_operator_last_redo(C);
- if (op == NULL || !STREQ(op->type->idname, "MESH_OT_spin")) {
- 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_spin");
}