mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[poincare/zoom] Improve null range
When displaying f(x) = undef, the range now defaults to an orthonormal range, centered on the origin, with axis unit 1. Change-Id: Ie3515be0572af4849b8ebd113449f4444755b34f
This commit is contained in:
committed by
Émilie Feral
parent
190568ea84
commit
482ca10363
@@ -184,11 +184,16 @@ void Zoom::RefinedYRangeForDisplay(ValueAtAbscissa evaluation, float xMin, float
|
||||
* its average order of magnitude. Then, bound is the value for the next
|
||||
* order of magnitude and is used to cut the Y range. */
|
||||
|
||||
float bound = (pop > 0) ? std::exp(sum / pop + 1.f) : FLT_MAX;
|
||||
sampleYMin = std::max(sampleYMin, - bound);
|
||||
sampleYMax = std::min(sampleYMax, bound);
|
||||
*yMin = sampleYMin;
|
||||
*yMax = sampleYMax;
|
||||
if (pop == 0) {
|
||||
*yMin = 0;
|
||||
*yMax = 0;
|
||||
} else {
|
||||
float bound = std::exp(sum / pop + 1.f);
|
||||
sampleYMin = std::max(sampleYMin, - bound);
|
||||
sampleYMax = std::min(sampleYMax, bound);
|
||||
*yMin = sampleYMin;
|
||||
*yMax = sampleYMax;
|
||||
}
|
||||
if (*yMin == *yMax) {
|
||||
RangeFromSingleValue(*yMin, yMin, yMax);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user