1st attempt to fix #1788

This commit is contained in:
Enrico Turri 2019-02-06 12:23:57 +01:00
parent 365f5297b1
commit 022b573bae

View File

@ -5337,9 +5337,16 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
p = p->GetParent();
auto *top_level_wnd = dynamic_cast<wxTopLevelWindow*>(p);
if (top_level_wnd && top_level_wnd->IsActive())
{
m_canvas->SetFocus();
}
// forces a frame render to ensure that m_hover_volume_id is updated even when the user right clicks while
// the context menu is shown, ensuring it to disappear if the mouse is outside any volume and to
// change the volume hover state if any is under the mouse
m_mouse.position = pos.cast<double>();
render();
}
}
m_mouse.set_start_position_2D_as_invalid();
//#endif
}
@ -5493,10 +5500,10 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
}
else if (evt.RightDown())
{
// forces a frame render to ensure that m_hover_volume_id is updated even when the user right clicks while
// the context menu is already shown, ensuring it to disappear if the mouse is outside any volume
m_mouse.position = Vec2d((double)pos(0), (double)pos(1));
render();
m_mouse.position = pos.cast<double>();
// // forces a frame render to ensure that m_hover_volume_id is updated even when the user right clicks while
// // the context menu is already shown, ensuring it to disappear if the mouse is outside any volume
// render();
if (m_hover_volume_id != -1)
{
// if right clicking on volume, propagate event through callback (shows context menu)
@ -5509,8 +5516,8 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
post_event(SimpleEvent(EVT_GLCANVAS_OBJECT_SELECT));
_update_gizmos_data();
wxGetApp().obj_manipul()->update_settings_value(m_selection);
// forces a frame render to update the view before the context menu is shown
render();
// // forces a frame render to update the view before the context menu is shown
// render();
Vec2d logical_pos = pos.cast<double>();
#if ENABLE_RETINA_GL