Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/xs
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2018-09-20 10:50:49 +0300
committerEnrico Turri <enricoturri@seznam.cz>2018-09-20 10:50:49 +0300
commitf1e0dc2dd714c9afae5d978e633646c0db8a7c57 (patch)
treec3b451a79c69ff6c3f97bf663cfaaf90f48513aa /xs
parent2306c1589a816dbda8ede8620842f0f6b24c8e8a (diff)
Ignore mouse up event after double click on gizmos grabbers
Diffstat (limited to 'xs')
-rw-r--r--xs/src/slic3r/GUI/GLCanvas3D.cpp16
-rw-r--r--xs/src/slic3r/GUI/GLCanvas3D.hpp3
2 files changed, 18 insertions, 1 deletions
diff --git a/xs/src/slic3r/GUI/GLCanvas3D.cpp b/xs/src/slic3r/GUI/GLCanvas3D.cpp
index c62652994..efb2b2dab 100644
--- a/xs/src/slic3r/GUI/GLCanvas3D.cpp
+++ b/xs/src/slic3r/GUI/GLCanvas3D.cpp
@@ -1095,6 +1095,9 @@ GLCanvas3D::Mouse::Drag::Drag()
GLCanvas3D::Mouse::Mouse()
: dragging(false)
, position(DBL_MAX, DBL_MAX)
+#if ENABLE_GIZMOS_RESET
+ , ignore_up_event(false)
+#endif // ENABLE_GIZMOS_RESET
{
}
@@ -3058,6 +3061,9 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
#if ENABLE_GIZMOS_RESET
else if (evt.LeftDClick() && m_gizmos.grabber_contains_mouse())
{
+#if ENABLE_GIZMOS_RESET
+ m_mouse.ignore_up_event = true;
+#endif // ENABLE_GIZMOS_RESET
m_gizmos.process_double_click();
switch (m_gizmos.get_current_type())
{
@@ -3075,7 +3081,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
m_on_gizmo_rotate_3D_callback.call(rotation(0), rotation(1), rotation(2));
#else
m_on_gizmo_rotate_callback.call((double)m_gizmos.get_angle_z());
-#endif //ENABLE_MODELINSTANCE_3D_ROTATION
+#endif // ENABLE_MODELINSTANCE_3D_ROTATION
update_rotation_values();
m_dirty = true;
break;
@@ -3421,12 +3427,20 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
else if (evt.LeftUp() && !m_mouse.dragging && (m_hover_volume_id == -1) && !gizmos_overlay_contains_mouse && !m_gizmos.is_dragging() && !is_layers_editing_enabled())
{
// deselect and propagate event through callback
+#if ENABLE_GIZMOS_RESET
+ if (!m_mouse.ignore_up_event && m_picking_enabled && !m_toolbar_action_running)
+#else
if (m_picking_enabled && !m_toolbar_action_running)
+#endif // ENABLE_GIZMOS_RESET
{
deselect_volumes();
_on_select(-1, -1);
update_gizmos_data();
}
+#if ENABLE_GIZMOS_RESET
+ else if (m_mouse.ignore_up_event)
+ m_mouse.ignore_up_event = false;
+#endif // ENABLE_GIZMOS_RESET
}
else if (evt.LeftUp() && m_gizmos.is_dragging())
{
diff --git a/xs/src/slic3r/GUI/GLCanvas3D.hpp b/xs/src/slic3r/GUI/GLCanvas3D.hpp
index 2c830f58e..b123efccf 100644
--- a/xs/src/slic3r/GUI/GLCanvas3D.hpp
+++ b/xs/src/slic3r/GUI/GLCanvas3D.hpp
@@ -315,6 +315,9 @@ class GLCanvas3D
bool dragging;
Vec2d position;
Drag drag;
+#if ENABLE_GIZMOS_RESET
+ bool ignore_up_event;
+#endif // ENABLE_GIZMOS_RESET
Mouse();