mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 01:15:55 +08:00
Measure Gizmo - Fixed volume's color blinking when pressing SHIFT key
This commit is contained in:
parent
a09c269584
commit
2ce76e27dd
@ -6705,6 +6705,10 @@ void GLCanvas3D::_render_selection_sidebar_hints()
|
|||||||
|
|
||||||
void GLCanvas3D::_update_volumes_hover_state()
|
void GLCanvas3D::_update_volumes_hover_state()
|
||||||
{
|
{
|
||||||
|
// skip update if the Gizmo Measure is active
|
||||||
|
if (m_gizmos.get_current_type() == GLGizmosManager::Measure)
|
||||||
|
return;
|
||||||
|
|
||||||
for (GLVolume* v : m_volumes.volumes) {
|
for (GLVolume* v : m_volumes.volumes) {
|
||||||
v->hover = GLVolume::HS_None;
|
v->hover = GLVolume::HS_None;
|
||||||
}
|
}
|
||||||
@ -6712,9 +6716,9 @@ void GLCanvas3D::_update_volumes_hover_state()
|
|||||||
if (m_hover_volume_idxs.empty())
|
if (m_hover_volume_idxs.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool ctrl_pressed = wxGetKeyState(WXK_CONTROL); // additive select/deselect
|
const bool ctrl_pressed = wxGetKeyState(WXK_CONTROL);
|
||||||
bool shift_pressed = wxGetKeyState(WXK_SHIFT); // select by rectangle
|
const bool shift_pressed = wxGetKeyState(WXK_SHIFT);
|
||||||
bool alt_pressed = wxGetKeyState(WXK_ALT); // deselect by rectangle
|
const bool alt_pressed = wxGetKeyState(WXK_ALT);
|
||||||
|
|
||||||
if (alt_pressed && (shift_pressed || ctrl_pressed)) {
|
if (alt_pressed && (shift_pressed || ctrl_pressed)) {
|
||||||
// illegal combinations of keys
|
// illegal combinations of keys
|
||||||
@ -6749,22 +6753,22 @@ void GLCanvas3D::_update_volumes_hover_state()
|
|||||||
if (volume.hover != GLVolume::HS_None)
|
if (volume.hover != GLVolume::HS_None)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool deselect = volume.selected && ((shift_pressed && m_rectangle_selection.is_empty()) || (alt_pressed && !m_rectangle_selection.is_empty()));
|
const bool deselect = volume.selected && ((shift_pressed && m_rectangle_selection.is_empty()) || (alt_pressed && !m_rectangle_selection.is_empty()));
|
||||||
bool select = !volume.selected && (m_rectangle_selection.is_empty() || (shift_pressed && !m_rectangle_selection.is_empty()));
|
const bool select = !volume.selected && (m_rectangle_selection.is_empty() || (shift_pressed && !m_rectangle_selection.is_empty()));
|
||||||
|
|
||||||
if (select || deselect) {
|
if (select || deselect) {
|
||||||
bool as_volume =
|
const bool as_volume =
|
||||||
volume.is_modifier && hover_from_single_instance && !ctrl_pressed &&
|
volume.is_modifier && hover_from_single_instance && !ctrl_pressed &&
|
||||||
(
|
(
|
||||||
(!deselect) ||
|
!deselect ||
|
||||||
(deselect && !m_selection.is_single_full_instance() && (volume.object_idx() == m_selection.get_object_idx()) && (volume.instance_idx() == m_selection.get_instance_idx()))
|
(deselect && !m_selection.is_single_full_instance() && volume.object_idx() == m_selection.get_object_idx() && volume.instance_idx() == m_selection.get_instance_idx())
|
||||||
);
|
);
|
||||||
|
|
||||||
if (as_volume)
|
if (as_volume)
|
||||||
volume.hover = deselect ? GLVolume::HS_Deselect : GLVolume::HS_Select;
|
volume.hover = deselect ? GLVolume::HS_Deselect : GLVolume::HS_Select;
|
||||||
else {
|
else {
|
||||||
int object_idx = volume.object_idx();
|
const int object_idx = volume.object_idx();
|
||||||
int instance_idx = volume.instance_idx();
|
const int instance_idx = volume.instance_idx();
|
||||||
|
|
||||||
for (GLVolume* v : m_volumes.volumes) {
|
for (GLVolume* v : m_volumes.volumes) {
|
||||||
if (v->object_idx() == object_idx && v->instance_idx() == instance_idx)
|
if (v->object_idx() == object_idx && v->instance_idx() == instance_idx)
|
||||||
|
@ -406,8 +406,6 @@ void GLGizmoMeasure::on_set_state()
|
|||||||
m_editing_distance = false;
|
m_editing_distance = false;
|
||||||
m_is_editing_distance_first_frame = true;
|
m_is_editing_distance_first_frame = true;
|
||||||
m_measuring.reset();
|
m_measuring.reset();
|
||||||
|
|
||||||
int a = 0;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_mode = EMode::BasicSelection;
|
m_mode = EMode::BasicSelection;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user