mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[poincare/zoom] Limit explosion detection
Do not take strong variations into account if they would erase more interesting variations. Change-Id: I6299a64bed449a611f90eda4234af10a183958d1
This commit is contained in:
committed by
Émilie Feral
parent
3a90ed6109
commit
82c4fe2190
@@ -152,8 +152,12 @@ bool Zoom::InterestingRangesForDisplay(ValueAtAbscissa evaluation, float * xMin,
|
||||
*yMax = NAN;
|
||||
return false;
|
||||
} else {
|
||||
resultX[0] = std::min(resultX[0], explosion[0]);
|
||||
resultX[1] = std::max(resultX[1], explosion[1]);
|
||||
float xMinWithExplosion = std::min(resultX[0], explosion[0]);
|
||||
float xMaxWithExplosion = std::max(resultX[1], explosion[1]);
|
||||
if (xMaxWithExplosion - xMinWithExplosion < k_maxRatioBetweenPointsOfInterest * (resultX[1] - resultX[0])) {
|
||||
resultX[0] = xMinWithExplosion;
|
||||
resultX[1] = xMaxWithExplosion;
|
||||
}
|
||||
/* Add breathing room around points of interest. */
|
||||
float xRange = resultX[1] - resultX[0];
|
||||
resultX[0] -= k_breathingRoom * xRange;
|
||||
|
||||
Reference in New Issue
Block a user