[interactive_curve_view_range] Fix assert

Change-Id: I2ff3cfe90f10b33db3e18b321cf931c9f0946479
This commit is contained in:
Gabriel Ozouf
2020-10-29 12:53:26 +01:00
committed by Émilie Feral
parent 9e9033537c
commit fe950386a0

View File

@@ -154,9 +154,10 @@ void InteractiveCurveViewRange::normalize() {
m_yRange.setMin(newYMin, k_lowerMaxFloat, k_upperMaxFloat);
MemoizedCurveViewRange::protectedSetYMax(newYMax, k_lowerMaxFloat, k_upperMaxFloat);
/* When the coordinates reach 10^7, the float type is not precise enough to
/* When the coordinates reach 10^6, the float type is not precise enough to
* properly normalize. */
constexpr float limit = 1e7f;
// FIXME : Fine a more precise way to filter the edge cases
constexpr float limit = 1e6f;
assert(isOrthonormal() || xMin() < -limit || xMax() > limit || yMin() < -limit || yMax() > limit);
(void) limit; // Silence compilation warning about unused variable.
setZoomNormalize(isOrthonormal());