BUGFIX: JKQTPCoordinateAxis::tickUnitName was not shown in some cases, when using fractions

This commit is contained in:
jkriege2 2023-12-19 11:04:19 +01:00
parent f4ac9374d4
commit 61ca14863f
2 changed files with 1 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -463,7 +463,7 @@ QString JKQTPCoordinateAxis::floattolabel(double data, int past_comma) const {
if (sign<0) res+="-"; if (sign<0) res+="-";
if (intpart!=0) res+=QString::number(intpart); if (intpart!=0) res+=QString::number(intpart);
if (num!=0) { if (num!=0) {
if (denom==1) res+=QString::number(num); if (denom==1) res+=addTickUnit(QString::number(num));
else { else {
if (axisStyle.tickLabelType==JKQTPCALTfrac || (axisStyle.tickLabelType==JKQTPCALTintfrac && intpart==0)) res+=QString("\\frac{%1}{%2}").arg(addTickUnit(QString::number(num))).arg(denom); if (axisStyle.tickLabelType==JKQTPCALTfrac || (axisStyle.tickLabelType==JKQTPCALTintfrac && intpart==0)) res+=QString("\\frac{%1}{%2}").arg(addTickUnit(QString::number(num))).arg(denom);
else if (axisStyle.tickLabelType==JKQTPCALTintfrac) res=addTickUnit(res+QString("\\frac{%1}{%2}").arg(num).arg(denom)); else if (axisStyle.tickLabelType==JKQTPCALTintfrac) res=addTickUnit(res+QString("\\frac{%1}{%2}").arg(num).arg(denom));