Cleanup: remove unused context check in toolsystem_ref_link
Also comment corrections.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user