3D viewer: Ensure the 3D display view is not modified after left clicking.

After opening a context menu and left clicking on the 3D canvas, the view
was modified because a drag event was generated, probably a wxWidgets bug.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17422
This commit is contained in:
jean-pierre charras 2024-11-11 16:46:10 +01:00
parent e24d43178a
commit 05e34714fc

View File

@ -830,6 +830,11 @@ void EDA_3D_CANVAS::OnLeftDown( wxMouseEvent& event )
SetFocus();
stop_editingTimeOut_Timer();
// Ensure m_camera.m_lastPosition (current mouse position) is up to date for
// future drag events (can be not the case when left clicking after
// opening a context menu)
OnMouseMoveCamera( event );
if( !event.Dragging() && ( m_3d_render_raytracing != nullptr ) )
{
RAY mouseRay = getRayAtCurrentMousePosition();