diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-06-27 09:40:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-06-27 09:40:25 +0300 |
commit | 4758b4033ec6c7b3cb85e46ff52ce062e291d0ad (patch) | |
tree | 727b04280293f43d98fd761a657f200f6b473f63 /source/blender | |
parent | 3128fe45919c69feb17d0dd5ec9850e58c42f446 (diff) |
Cleanup: remove unused context check in toolsystem_ref_link
Also comment corrections.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c | 6 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_toolsystem.c | 12 |
2 files changed, 4 insertions, 14 deletions
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index f57760cdc2b..beb2707d94d 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -629,7 +629,7 @@ static wmGizmo *gizmo_find_intersected_3d(bContext *C, { for (int select_id = 0; select_id < visible_gizmos_len; select_id++) { wmGizmo *gz = visible_gizmos[select_id]; - /* With both defined, favor the 3D, incase the gizmo can be used in 2D or 3D views. */ + /* With both defined, favor the 3D, in case the gizmo can be used in 2D or 3D views. */ if (gz->type->test_select && (gz->type->draw_select == NULL)) { if ((*r_part = gz->type->test_select(C, gz, co)) != -1) { hit = select_id; @@ -1257,8 +1257,8 @@ void WM_gizmoconfig_update_tag_remove(wmGizmoMapType *gzmap_type, wmGizmoGroupTy } /** - * Run incase new types have been added (runs often, early exit where possible). - * Follows #WM_keyconfig_update concentions. + * Run in case new types have been added (runs often, early exit where possible). + * Follows #WM_keyconfig_update conventions. */ void WM_gizmoconfig_update(struct Main *bmain) { diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index fa69d750665..95b072532a4 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -169,9 +169,6 @@ void WM_toolsystem_unlink(bContext *C, WorkSpace *workspace, const bToolKey *tke } } -/** - * \see #toolsystem_ref_link - */ static void toolsystem_ref_link(bContext *C, WorkSpace *workspace, bToolRef *tref) { bToolRef_Runtime *tref_rt = tref->runtime; @@ -664,14 +661,7 @@ bToolRef *WM_toolsystem_ref_set_by_id( WM_operator_properties_create_ptr(&op_props, ot); RNA_string_set(&op_props, "name", name); - /* Will get from context if not set. */ - bToolKey tkey_from_context; - if (tkey == NULL) { - ViewLayer *view_layer = CTX_data_view_layer(C); - ScrArea *sa = CTX_wm_area(C); - WM_toolsystem_key_from_context(view_layer, sa, &tkey_from_context); - tkey = &tkey_from_context; - } + BLI_assert((1 << tkey->space_type) & WM_TOOLSYSTEM_SPACE_MASK); BLI_assert((1 << tkey->space_type) & WM_TOOLSYSTEM_SPACE_MASK); |