Another synch with branch et_selection_rectangle

This commit is contained in:
Enrico Turri 2019-04-26 14:07:05 +02:00
parent e3b5885a3c
commit 049d4ba335
2 changed files with 12 additions and 1 deletions

View File

@ -675,6 +675,7 @@ GLCanvas3D::Mouse::Mouse()
: dragging(false)
, position(DBL_MAX, DBL_MAX)
, scene_position(DBL_MAX, DBL_MAX, DBL_MAX)
, ignore_left_up(false)
{
}
@ -2387,6 +2388,7 @@ void GLCanvas3D::on_key(wxKeyEvent& evt)
{
_update_selection_from_hover();
m_rectangle_selection.stop_dragging();
m_mouse.ignore_left_up = true;
m_dirty = true;
}
set_cursor(Standard);
@ -2397,6 +2399,7 @@ void GLCanvas3D::on_key(wxKeyEvent& evt)
{
_update_selection_from_hover();
m_rectangle_selection.stop_dragging();
m_mouse.ignore_left_up = true;
m_dirty = true;
}
set_cursor(Standard);
@ -2409,13 +2412,19 @@ void GLCanvas3D::on_key(wxKeyEvent& evt)
if (keyCode == WXK_SHIFT)
{
if (m_picking_enabled && (m_gizmos.get_current_type() != GLGizmosManager::SlaSupports))
{
m_mouse.ignore_left_up = false;
set_cursor(Cross);
}
}
else if (keyCode == WXK_ALT)
{
if (m_picking_enabled && (m_gizmos.get_current_type() != GLGizmosManager::SlaSupports))
{
m_mouse.ignore_left_up = false;
set_cursor(Cross);
}
}
else if (keyCode == WXK_CONTROL)
m_dirty = true;
}
@ -2536,6 +2545,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
m_mouse.set_start_position_3D_as_invalid();
m_mouse.set_start_position_2D_as_invalid();
m_mouse.dragging = false;
m_mouse.ignore_left_up = false;
m_dirty = true;
if (m_canvas->HasCapture())
@ -2857,7 +2867,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
m_rectangle_selection.stop_dragging();
}
else if (evt.LeftUp() && !m_mouse.dragging && m_hover_volume_idxs.empty() && !is_layers_editing_enabled())
else if (evt.LeftUp() && !m_mouse.ignore_left_up && !m_mouse.dragging && m_hover_volume_idxs.empty() && !is_layers_editing_enabled())
{
// deselect and propagate event through callback
if (!evt.ShiftDown() && m_picking_enabled)

View File

@ -303,6 +303,7 @@ class GLCanvas3D
Vec2d position;
Vec3d scene_position;
Drag drag;
bool ignore_left_up;
Mouse();