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

This commit is contained in:
jkriege2 2022-05-14 22:59:10 +02:00
parent a80ea3a24a
commit 94f80510ec
2 changed files with 5 additions and 8 deletions

View File

@ -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:
<ul>
<li>fixed issue described in <a href="https://github.com/jkriege2/JKQtPlotter/pull/62">#62: Fix custom labels draw, because giving exactly two label-strings did not display all of them</a>, thanks to <a href="https://github.com/FalsinSoft">user:FalsinSoft</a></li>
<li>fixed issue <a href="https://github.com/jkriege2/JKQtPlotter/pull/70">#70: Typo in jkqtplotter/CMakeLists.txt</a>, thanks to <a href="https://github.com/tedlinlab">user:tedlinlab</a></li>
<li>NEW: JKQTPFilledCurveXGraph and JKQTPFilledCurveYGraph can now plot wiggle plots with different fill styles above and below the baseline (feature request <a href="https://github.com/jkriege2/JKQtPlotter/issues/68">#68 Wiggle Plots</a> from <a href="https://github.com/xichaoqiang">user:xichaoqiang</a> </li>
</ul>

View File

@ -1011,14 +1011,10 @@ bool JKQTPCoordinateAxis::getNextLabel(double& x, QString& label, bool init) {
return (tickLabels.size()>0);
} else {
for (int i=0; i<tickLabels.size(); i++) {
if (x==tickLabels[i].first && i+1<tickLabels.size()) {
if (x>=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<tickLabels.size()) {
label=tickLabels[i+1].second;
x=tickLabels[i+1].first;
return (x>=axismin && x<=axismax);
}
}
}