diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-06-06 08:32:05 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-06-06 08:33:13 -0400 |
commit | b54a2713a170ef611e1185251d5d80c0e968cfc3 (patch) | |
tree | 93c1e4681315fd9a8851a53956c4d8e0df4d901e /libs/canvas/rectangle.cc | |
parent | d7fc573cb8c4292b6150a6f52e4a38df96a61e5f (diff) |
When rendering a Canvas::Rectangle take its _position into account, even though in general this is always (0,0) within its parent
Diffstat (limited to 'libs/canvas/rectangle.cc')
-rw-r--r-- | libs/canvas/rectangle.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/canvas/rectangle.cc b/libs/canvas/rectangle.cc index 57c26874c4..cea5567dcc 100644 --- a/libs/canvas/rectangle.cc +++ b/libs/canvas/rectangle.cc @@ -51,7 +51,12 @@ Rectangle::Rectangle (Group* parent, Rect const & rect) void Rectangle::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const { - Rect self = item_to_window (_rect); + /* In general, a Rectangle will have a _position of (0,0) within its + parent, and its extent is actually defined by _rect. But in the + unusual case that _position is set to something other than (0,0), + we should take that into account when rendering. + */ + Rect self = item_to_window (_rect.translate (_position)); boost::optional<Rect> r = self.intersection (area); if (!r) { |