From 06d0813a1dd34a480b7c0dae77f6e6ff812775e2 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 10 Jun 2020 15:01:02 -0600 Subject: [PATCH] Canvas: Text item should take position into account when rendering --- libs/canvas/text.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/canvas/text.cc b/libs/canvas/text.cc index ed879e2e80..5707192b96 100644 --- a/libs/canvas/text.cc +++ b/libs/canvas/text.cc @@ -194,7 +194,7 @@ Text::render (Rect const & area, Cairo::RefPtr context) const return; } - Rect self = item_to_window (Rect (0, 0, min (_clamped_width, (double)_image->get_width ()), _image->get_height ())); + Rect self = item_to_window (Rect (_position.x, _position.y, _position.x + min (_clamped_width, (double)_image->get_width ()), _position.y + _image->get_height ())); Rect i = self.intersection (area); if (!i) { @@ -325,3 +325,4 @@ Text::text_width() const return _width; } +