mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/regression] Fix vertical navigation if 2 series have same point
Data set: X1: 8 9 10 10 Y1: 2 5 1 2 X2: 10 12 5 Y2: 2 0 8
This commit is contained in:
@@ -61,7 +61,9 @@ int Store::closestVerticalDot(int direction, double x, double y, int currentSeri
|
||||
double currentY = i < numberOfPoints ? m_data[series][1][i] : meanOfColumn(series, 1);
|
||||
if (m_xMin <= currentX && currentX <= m_xMax // The next dot is within the window abscissa bounds
|
||||
&& (std::fabs(currentX - x) <= std::fabs(nextX - x)) // The next dot is the closest to x in abscissa
|
||||
&& ((currentY >= y) == (direction > 0)) // The next dot is above/under y
|
||||
&& ((currentY > y && direction > 0) // The next dot is above/under y
|
||||
|| (currentY < y && direction < 0)
|
||||
|| (currentY == y && (currentDot < 0 || ((direction < 0) == (series > currentSeries)))))
|
||||
&& (nextX != currentX // Edge case: if 2 dots have the same abscissa but different ordinates
|
||||
|| ((currentY <= nextY) == (direction > 0))))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user