Fix issue that you cannot select multiple brim ears with shift+left click

This commit is contained in:
Noisyfox
2025-03-31 23:23:23 +08:00
parent f6dc9c1ab4
commit 8210d76449

View File

@@ -265,16 +265,12 @@ void GLGizmoBrimEars::data_changed(bool is_serializing)
bool GLGizmoBrimEars::on_mouse(const wxMouseEvent& mouse_event) bool GLGizmoBrimEars::on_mouse(const wxMouseEvent& mouse_event)
{ {
if (use_grabbers(mouse_event)) {
return true;
}
// wxCoord == int --> wx/types.h // wxCoord == int --> wx/types.h
Vec2i32 mouse_coord(mouse_event.GetX(), mouse_event.GetY()); Vec2i32 mouse_coord(mouse_event.GetX(), mouse_event.GetY());
Vec2d mouse_pos = mouse_coord.cast<double>(); Vec2d mouse_pos = mouse_coord.cast<double>();
if (mouse_event.Moving()) { if (mouse_event.Moving()) {
return gizmo_event(SLAGizmoEventType::Moving, mouse_pos, mouse_event.ShiftDown(), mouse_event.AltDown(), false); gizmo_event(SLAGizmoEventType::Moving, mouse_pos, mouse_event.ShiftDown(), mouse_event.AltDown(), false);
} }
// when control is down we allow scene pan and rotation even when clicking // when control is down we allow scene pan and rotation even when clicking
@@ -317,15 +313,15 @@ bool GLGizmoBrimEars::on_mouse(const wxMouseEvent& mouse_event)
return false; return false;
} }
} else if (mouse_event.LeftUp()) { } else if (mouse_event.LeftUp()) {
if (!m_parent.is_mouse_dragging()) { if (gizmo_event(SLAGizmoEventType::LeftUp, mouse_pos, mouse_event.ShiftDown(), mouse_event.AltDown(), control_down)
&& !m_parent.is_mouse_dragging()) {
// in case SLA/FDM gizmo is selected, we just pass the LeftUp // in case SLA/FDM gizmo is selected, we just pass the LeftUp
// event and stop processing - neither object moving or selecting // event and stop processing - neither object moving or selecting
// is suppressed in that case // is suppressed in that case
gizmo_event(SLAGizmoEventType::LeftUp, mouse_pos, mouse_event.ShiftDown(), mouse_event.AltDown(), control_down);
return true; return true;
} }
} }
return false; return use_grabbers(mouse_event);
} }
// Following function is called from GLCanvas3D to inform the gizmo about a mouse/keyboard event. // Following function is called from GLCanvas3D to inform the gizmo about a mouse/keyboard event.