From 8a14a7a00bd62c72a4907c4c25d9e0b531a26968 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 30 Dec 2020 00:04:47 +0100 Subject: [PATCH] Fix tracking-text offset If position along a given axis is not tracked, then the offset was applied repeatedly to the current position. This caused the coordinate to run away. --- libs/canvas/tracking_text.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/canvas/tracking_text.cc b/libs/canvas/tracking_text.cc index f8f246c403..dd23f291f2 100644 --- a/libs/canvas/tracking_text.cc +++ b/libs/canvas/tracking_text.cc @@ -61,14 +61,16 @@ TrackingText::pointer_motion (Duple const& winpos) if (!track_x) { pos.x = position ().x; + } else { + pos.x += offset.x; } if (!track_y) { pos.y = position ().y; + } else { + pos.y += offset.y; } - pos = pos.translate (offset); - /* keep inside the window */ Rect r (0, 0, _canvas->width (), _canvas->height ());