Don't allow selection change in paint gizmo (#8776)

If object has modifier, in some paint gizmos such as seam and support
paint, if you click the modifier, the gizmo will exit:

![paint-modifier](https://github.com/user-attachments/assets/5680a19f-5de7-485e-bf73-3d79b6a080a9)

This PR fixes this issue so the gizmo won't accidentally exit.
This commit is contained in:
Noisyfox 2025-04-13 17:35:12 +08:00 committed by GitHub
parent 5ed855aeef
commit 61a68fb497
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1061,6 +1061,7 @@ void GLGizmoPainterBase::on_set_state()
return; return;
if (m_state == On && m_old_state != On) { // the gizmo was just turned on if (m_state == On && m_old_state != On) { // the gizmo was just turned on
m_parent.enable_picking(false);
on_opening(); on_opening();
const Selection& selection = m_parent.get_selection(); const Selection& selection = m_parent.get_selection();
@ -1072,6 +1073,7 @@ void GLGizmoPainterBase::on_set_state()
//camera.look_at(position, rotate_target, Vec3d::UnitZ()); //camera.look_at(position, rotate_target, Vec3d::UnitZ());
} }
if (m_state == Off && m_old_state != Off) { // the gizmo was just turned Off if (m_state == Off && m_old_state != Off) { // the gizmo was just turned Off
m_parent.enable_picking(true);
// we are actually shutting down // we are actually shutting down
on_shutdown(); on_shutdown();
m_old_mo_id = -1; m_old_mo_id = -1;