mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[interactive_curve_view_range] isOrthonormal
Change-Id: I154487908d1a2a11e01b2a4e51ef867e235babab
This commit is contained in:
committed by
Émilie Feral
parent
29714b401e
commit
5d9c7b0c1f
@@ -189,9 +189,12 @@ void InteractiveCurveViewRange::panToMakePointVisible(float x, float y, float to
|
||||
}
|
||||
|
||||
void InteractiveCurveViewRange::checkForNormalizedRange() {
|
||||
float pixelHeight = std::round(Ion::Display::Height * (NormalizedYHalfRange(100.f) / Ion::Display::HeightInTenthOfMillimeter));
|
||||
float pixelWidth = std::round(Ion::Display::Width * (NormalizedXHalfRange(100.f) / Ion::Display::WidthInTenthOfMillimeter));
|
||||
m_zoomNormalize = std::round(pixelHeight * (xMax() - xMin())) == std::round(pixelWidth * (yMax() - yMin()));
|
||||
m_zoomNormalize = isOrthonormal();
|
||||
}
|
||||
|
||||
bool InteractiveCurveViewRange::isOrthonormal(float tolerance) const {
|
||||
float pixelHeight = std::round(Ion::Display::Height * (NormalizedYHalfRange(100.f) / Ion::Display::HeightInTenthOfMillimeter));
|
||||
float pixelWidth = std::round(Ion::Display::Width * (NormalizedXHalfRange(100.f) / Ion::Display::WidthInTenthOfMillimeter));
|
||||
return std::fabs(std::round(pixelHeight * (xMax() - xMin())) - std::round(pixelWidth * (yMax() - yMin()))) <= tolerance;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user