From f463b9d01790d437c81007b528bf43e940c014c5 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Thu, 3 Aug 2023 22:23:39 +0100 Subject: [PATCH] Don't calculate minor ticks when there are no major ticks to be between Fixes https://gitlab.com/kicad/code/kicad/-/issues/15179#note_1480427547 --- common/widgets/mathplot.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/widgets/mathplot.cpp b/common/widgets/mathplot.cpp index 553809b51a..8cb91e9457 100644 --- a/common/widgets/mathplot.cpp +++ b/common/widgets/mathplot.cpp @@ -775,7 +775,8 @@ void mpScaleY::getVisibleDataRange( mpWindow& w, double& minV, double& maxV ) void mpScaleY::computeSlaveTicks( mpWindow& w ) { - if( m_masterScale->m_tickValues.size() == 0 ) + // No need for slave ticks when there aren't 2 main ticks for them to go between + if( m_masterScale->m_tickValues.size() < 2 ) return; m_tickValues.clear();