From 94f80510ec01ac7c6ee3f92628be7beb158bb12e Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Sat, 14 May 2022 22:59:10 +0200 Subject: [PATCH] fixed issue described in PR #62: Fix custom labels draw, because giving exactly two label-strings did not display all of them, thanks to github_user:FalsinSoft --- doc/dox/whatsnew.dox | 1 + lib/jkqtplotter/jkqtpcoordinateaxes.cpp | 12 ++++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/doc/dox/whatsnew.dox b/doc/dox/whatsnew.dox index c48a29b271..7bcb2fe753 100644 --- a/doc/dox/whatsnew.dox +++ b/doc/dox/whatsnew.dox @@ -14,6 +14,7 @@ This page lists release notes for the diferent version of JKQTPlotter \subsection page_whatsnew_TRUNK_OVERVIEW trunk: Overview Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include: diff --git a/lib/jkqtplotter/jkqtpcoordinateaxes.cpp b/lib/jkqtplotter/jkqtpcoordinateaxes.cpp index 3ae8ea92a8..f2fd5985f2 100644 --- a/lib/jkqtplotter/jkqtpcoordinateaxes.cpp +++ b/lib/jkqtplotter/jkqtpcoordinateaxes.cpp @@ -1011,14 +1011,10 @@ bool JKQTPCoordinateAxis::getNextLabel(double& x, QString& label, bool init) { return (tickLabels.size()>0); } else { for (int i=0; i=axismin && x<=axismax) { - label=tickLabels[i+1].second; - x=tickLabels[i+1].first; - return true; - } else { - return false; - } + if (fabs(x-tickLabels[i].first)<1e-30 && i+1=axismin && x<=axismax); } } }