diff options
author | Dimitrios Apostolou <jimis@qt.io> | 2021-05-19 12:20:00 +0200 |
---|---|---|
committer | Dimitrios Apostolou <jimis@qt.io> | 2021-05-21 15:26:04 +0200 |
commit | afe2683066ab3bb68f0bb22b2a125da2af3447af (patch) | |
tree | 9b59dbd56fc15527237c01068e9723e7448769f6 /src/charts/axis/chartaxiselement.cpp | |
parent | 392e2ba9c739c952f8a868f94ee9cddd97b2d1bb (diff) |
Fix assert crash when zooming too much
Remove usage of qFuzzyCompare() when zooming in/out on the cartesian
axis charts. Floating point comparisons work fine after the previous
patch removed qCeil() and int() so that no conversions to integral types
happen any longer.
Now one can zoom in/out as much as he likes without any crashes or hangs.
Task-number: QTBUG-93672
Change-Id: I72eae8ae2151f41efda0e37a26a8f66a3d93d26b
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/charts/axis/chartaxiselement.cpp')
-rw-r--r-- | src/charts/axis/chartaxiselement.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/charts/axis/chartaxiselement.cpp b/src/charts/axis/chartaxiselement.cpp index 6985e1ab..b17f5cdb 100644 --- a/src/charts/axis/chartaxiselement.cpp +++ b/src/charts/axis/chartaxiselement.cpp @@ -436,7 +436,7 @@ QStringList ChartAxisElement::createValueLabels(qreal min, qreal max, int ticks, else value = value + std::ceil((min - value) / tickInterval) * tickInterval; - while (value <= max || qFuzzyCompare(value, max)) { + while (value <= max) { labels << presenter()->numberToString(value, 'f', n); value += tickInterval; } @@ -478,7 +478,7 @@ QStringList ChartAxisElement::createValueLabels(qreal min, qreal max, int ticks, else value = value + std::ceil((min - value) / tickInterval) * tickInterval; - while (value <= max || qFuzzyCompare(value, max)) { + while (value <= max) { labels << formatLabel(formatSpec, array, value, precision, preStr, postStr); value += tickInterval; } |