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.
This commit is contained in:
parent
d741f01ad0
commit
8a14a7a00b
@ -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 ());
|
||||
|
Loading…
Reference in New Issue
Block a user