mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[graph] Take margins into account for normalization
When building an orthonormal range for the automatic zoom, we provide a ratio for the screen without the margins. This way, adding the margins will make the graph orthonormal, and the banner cannot cover the function. Change-Id: If3a3f799d4e7e3e81ab77c6b418d70b734a6fbca
This commit is contained in:
committed by
LeaNumworks
parent
a8858023ba
commit
c89a7bc496
@@ -261,7 +261,7 @@ void ContinuousFunction::setTMax(float tMax) {
|
||||
setCache(nullptr);
|
||||
}
|
||||
|
||||
void ContinuousFunction::rangeForDisplay(float * xMin, float * xMax, float * yMin, float * yMax, Poincare::Context * context) const {
|
||||
void ContinuousFunction::rangeForDisplay(float * xMin, float * xMax, float * yMin, float * yMax, float targetRatio, Poincare::Context * context) const {
|
||||
if (plotType() != PlotType::Cartesian) {
|
||||
assert(std::isfinite(tMin()) && std::isfinite(tMax()) && std::isfinite(rangeStep()) && rangeStep() > 0);
|
||||
protectedFullRangeForDisplay(tMin(), tMax(), rangeStep(), xMin, xMax, context, true);
|
||||
@@ -291,7 +291,7 @@ void ContinuousFunction::rangeForDisplay(float * xMin, float * xMax, float * yMi
|
||||
}
|
||||
|
||||
/* Try to display an orthonormal range. */
|
||||
Zoom::RangeWithRatioForDisplay(evaluation, InteractiveCurveViewRange::NormalYXRatio(), xMin, xMax, yMin, yMax, context, this);
|
||||
Zoom::RangeWithRatioForDisplay(evaluation, targetRatio, xMin, xMax, yMin, yMax, context, this);
|
||||
if (std::isfinite(*xMin) && std::isfinite(*xMax) && std::isfinite(*yMin) && std::isfinite(*yMax)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user