From 42bb5701d5bf8f1edab3d2434353f5ceb161f380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Thebault?= Date: Sun, 26 Jul 2026 08:19:52 +0200 Subject: [PATCH] fix annot slope --- src/drawing/annot.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drawing/annot.rs b/src/drawing/annot.rs index 7651a47..8c679d5 100644 --- a/src/drawing/annot.rs +++ b/src/drawing/annot.rs @@ -234,7 +234,8 @@ impl Annot { let x1 = map_x_annot_coord(x, x_axis, y_axis, plot_rect); let y1 = map_y_annot_coord(y, x_axis, y_axis, plot_rect); let x2 = x1 + 100.0; - let y2 = y1 + 100.0 * slope; + // negative slope because Y axis is inverted in screen coordinates + let y2 = y1 - 100.0 * slope; let p1 = geom::Point { x: x1, y: y1 }; let p2 = geom::Point { x: x2, y: y2 }; (p1, p2)