diff --git a/libs/canvas/text.cc b/libs/canvas/text.cc index 17e5fbaec0..12a0f38842 100644 --- a/libs/canvas/text.cc +++ b/libs/canvas/text.cc @@ -192,10 +192,11 @@ Text::render (Rect const & area, Cairo::RefPtr context) const return; } - 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); + const Rect r (0, 0, min (_clamped_width, (double)_image->get_width ()), _image->get_height ()); + Rect self = item_to_window (r); + Rect intersection = self.intersection (area); - if (!i) { + if (!intersection) { return; } @@ -203,8 +204,6 @@ Text::render (Rect const & area, Cairo::RefPtr context) const _redraw (); } - Rect intersection (i); - context->rectangle (intersection.x0, intersection.y0, intersection.width(), intersection.height()); #ifdef __APPLE__ /* Below, the rendering scaling is set to support retina display