[interactive_curve_view_range] Fix isOrthonormal when using Navigate

The method isOrthonormal takes into account the "offscreen" portion of
the Y axis. This fixes a bug where zooming when using the Navigate
option would remove the orthonormality marker while the graph was still
orthonormal.
This commit is contained in:
Gabriel Ozouf
2021-01-04 15:48:16 +01:00
committed by LeaNumworks
parent 878685b83c
commit 5b106f091d

View File

@@ -112,8 +112,8 @@ void InteractiveCurveViewRange::zoom(float ratio, float x, float y) {
m_yRange.setMax(yMa, k_lowerMaxFloat, k_upperMaxFloat);
MemoizedCurveViewRange::protectedSetYMin(yMi, k_lowerMaxFloat, k_upperMaxFloat);
}
setZoomNormalize(isOrthonormal());
m_offscreenYAxis *= ratio;
setZoomNormalize(isOrthonormal());
}
void InteractiveCurveViewRange::panWithVector(float x, float y) {
@@ -291,7 +291,7 @@ bool InteractiveCurveViewRange::isOrthonormal() const {
if (significantBits <= 0) {
return false;
}
float ratio = (yMax() - yMin()) / (xMax() - xMin());
float ratio = (yMax() - yMin() + offscreenYAxis()) / (xMax() - xMin());
/* The last N (= 23 - significantBits) bits of "ratio" mantissa have become
* insignificant. "tolerance" is the difference between ratio with those N
* bits set to 1, and ratio with those N bits set to 0 ; i.e. a measure of