Fix #120551: Loop Cut tool fails when Select Circle tool is active

Allow pre-select gizmos to be "highlighted" so they can override
the fallback tool key-map items.
This commit is contained in:
Campbell Barton
2024-04-25 16:06:06 +10:00
parent 2a0074c930
commit e8229fccba

View File

@@ -267,12 +267,15 @@ static int gizmo_preselect_elem_test_select(bContext *C, wmGizmo *gz, const int
ED_region_tag_redraw_editor_overlays(region);
}
// return best.eed ? 0 : -1;
return -1;
return best.ele ? 0 : -1;
}
static void gizmo_preselect_elem_setup(wmGizmo *gz)
{
/* Needed so it's possible to "highlight" the gizmo without having the
* tweak operator attempting to handle it's input. */
gz->flag |= WM_GIZMO_HIDDEN_KEYMAP;
MeshElemGizmo3D *gz_ele = (MeshElemGizmo3D *)gz;
if (gz_ele->psel == nullptr) {
gz_ele->psel = EDBM_preselect_elem_create();
@@ -425,12 +428,15 @@ static int gizmo_preselect_edgering_test_select(bContext *C, wmGizmo *gz, const
ED_region_tag_redraw_editor_overlays(region);
}
// return best.eed ? 0 : -1;
return -1;
return best.eed ? 0 : -1;
}
static void gizmo_preselect_edgering_setup(wmGizmo *gz)
{
/* Needed so it's possible to "highlight" the gizmo without having the
* tweak operator attempting to handle it's input. */
gz->flag |= WM_GIZMO_HIDDEN_KEYMAP;
MeshEdgeRingGizmo3D *gz_ring = (MeshEdgeRingGizmo3D *)gz;
if (gz_ring->psel == nullptr) {
gz_ring->psel = EDBM_preselect_edgering_create();