From 06074d91925ed441380098d5ed8ecf1b19638a44 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 27 Oct 2023 08:13:44 +0200 Subject: [PATCH] Simulator, plot panel: Honor dragging in Y direction. Fixes #15914 https://gitlab.com/kicad/code/kicad/-/issues/15914 --- common/widgets/mathplot.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/common/widgets/mathplot.cpp b/common/widgets/mathplot.cpp index 34cd5d8628..cc27b9e49a 100644 --- a/common/widgets/mathplot.cpp +++ b/common/widgets/mathplot.cpp @@ -1601,14 +1601,20 @@ void mpWindow::onMouseMove( wxMouseEvent& event ) m_mouseMClick.x = event.GetX(); m_mouseMClick.y = event.GetY(); - double Ax_units = Ax / m_scaleX; - double Ay_units = -Ay / m_scaleY; - - if( SetXView( m_posX + Ax_units, m_desiredXmax + Ax_units, m_desiredXmin + Ax_units ) - || SetYView( m_posY + Ay_units, m_desiredYmax + Ay_units, m_desiredYmin + Ay_units ) ) + if( Ax ) { - UpdateAll(); + double Ax_units = Ax / m_scaleX; + SetXView( m_posX + Ax_units, m_desiredXmax + Ax_units, m_desiredXmin + Ax_units ); } + + if( Ay ) + { + double Ay_units = -Ay / m_scaleY; + SetYView( m_posY + Ay_units, m_desiredYmax + Ay_units, m_desiredYmin + Ay_units ); + } + + if( Ax || Ay ) + UpdateAll(); } else if( event.m_leftDown ) {