Mouse capture when dragging gizmos

This commit is contained in:
Enrico Turri 2018-08-24 15:49:57 +02:00
parent cda135ada7
commit 220d430956
2 changed files with 7 additions and 0 deletions

View File

@ -3111,6 +3111,8 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
} }
else if (evt.Dragging() && m_gizmos.is_dragging()) else if (evt.Dragging() && m_gizmos.is_dragging())
{ {
m_canvas->CaptureMouse();
m_mouse.dragging = true; m_mouse.dragging = true;
m_gizmos.update(mouse_ray(pos)); m_gizmos.update(mouse_ray(pos));
@ -3286,6 +3288,9 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
m_mouse.dragging = false; m_mouse.dragging = false;
m_toolbar_action_running = false; m_toolbar_action_running = false;
m_dirty = true; m_dirty = true;
if (m_canvas->HasCapture())
m_canvas->ReleaseMouse();
} }
else if (evt.Moving()) else if (evt.Moving())
{ {

View File

@ -197,6 +197,8 @@ void GLGizmoBase::start_dragging()
void GLGizmoBase::stop_dragging() void GLGizmoBase::stop_dragging()
{ {
set_tooltip("");
for (int i = 0; i < (int)m_grabbers.size(); ++i) for (int i = 0; i < (int)m_grabbers.size(); ++i)
{ {
m_grabbers[i].dragging = false; m_grabbers[i].dragging = false;