diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-18 10:35:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-18 10:40:52 +0300 |
commit | 987d1df57159afd57f33d7e58681be2fcdebda16 (patch) | |
tree | f782562c40bc1bf3fe23a455779f7e30d4cd8559 /source/blender/editors/mesh/editmesh_extrude.c | |
parent | 8faa59441371311a435b80487fe81eb60ea2e4fe (diff) |
Tool System: store the active tool in ScrArea
Without this we need to have the context to get the
(space_type, mode) args for an active tool lookup.
For event handling & poll its more convenient to have direct access.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_extrude.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_extrude.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c index 95bf8e89b0e..4841de3c856 100644 --- a/source/blender/editors/mesh/editmesh_extrude.c +++ b/source/blender/editors/mesh/editmesh_extrude.c @@ -419,9 +419,8 @@ static void manipulator_mesh_extrude_orientation_matrix_set( static bool manipulator_mesh_extrude_poll(const bContext *C, wmManipulatorGroupType *wgt) { - WorkSpace *workspace = CTX_wm_workspace(C); - const bToolKey tkey = { .space_type = SPACE_VIEW3D, .mode = CTX_MODE_EDIT_MESH, }; - bToolRef_Runtime *tref_rt = WM_toolsystem_runtime_find(workspace, &tkey); + ScrArea *sa = CTX_wm_area(C); + bToolRef_Runtime *tref_rt = sa->runtime.tool ? sa->runtime.tool->runtime : NULL; if ((tref_rt == NULL) || !STREQ(wgt->idname, tref_rt->manipulator_group) || !ED_operator_editmesh_view3d((bContext *)C)) |