Commit 79115c7
committed
Fix ErrorBarCurveItem.get_closest_coordinates snap-to-bounds typo
The error-bar snapping logic in `get_closest_coordinates` compared
`abs(y - y)` and `abs(x - x)` (always 0) instead of the distance to the
current curve point `abs(y - yi)` / `abs(x - xi)`. As a result, the
snap-to-error-bound branches were dead code and the closest coordinate
returned was always the central curve point, never the upper/lower error
bound — even when the cursor was clearly closest to a bar end.
Replace the four self-subtractions with the correct distance to the
sampled point so cursor queries snap to the nearest error-bar bound as
documented.1 parent 1376d00 commit 79115c7
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| |||
0 commit comments