From 4bfbf91369b9afe5b2db7b0ab6bfa0c19d6d0303 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 30 Jul 2022 11:38:31 +0200 Subject: [PATCH] 3D viewer: Fix incorrect behavior when moving the scene Fixes #12114 https://gitlab.com/kicad/code/kicad/issues/12114 --- 3d-viewer/3d_canvas/eda_3d_canvas.cpp | 7 +++++-- common/gal/hidpi_gl_3D_canvas.cpp | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.cpp b/3d-viewer/3d_canvas/eda_3d_canvas.cpp index 34607c1d9e..11433e5ffe 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.cpp +++ b/3d-viewer/3d_canvas/eda_3d_canvas.cpp @@ -617,14 +617,17 @@ void EDA_3D_CANVAS::OnMagnify( wxMouseEvent& event ) void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event ) { - //wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::OnMouseMove" ) ); + if( m_camera_is_moving ) + return; + OnMouseMoveCamera( event ); if( m_mouse_was_moved ) { DisplayStatus(); Request_refresh(); - restart_editingTimeOut_Timer(); + // *Do not* reactivate the timer here during the mouse move command: + // OnMiddleUp() will do it at the end of mouse drag/move command } if( !event.Dragging() && m_boardAdapter.m_Cfg->m_Render.engine == RENDER_ENGINE::OPENGL ) diff --git a/common/gal/hidpi_gl_3D_canvas.cpp b/common/gal/hidpi_gl_3D_canvas.cpp index 06cc6c5ce6..a98c7cf324 100644 --- a/common/gal/hidpi_gl_3D_canvas.cpp +++ b/common/gal/hidpi_gl_3D_canvas.cpp @@ -60,6 +60,7 @@ void HIDPI_GL_3D_CANVAS::OnMouseMoveCamera( wxMouseEvent& event ) m_mouse_is_moving = true; m_mouse_was_moved = true; } + m_camera.SetCurMousePosition( nativePosition ); }