mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 08:14:58 +01:00
When rendering a Canvas::Rectangle take its _position into account, even though in general this is always (0,0) within its parent
This commit is contained in:
parent
d7fc573cb8
commit
b54a2713a1
1 changed files with 6 additions and 1 deletions
|
|
@ -51,7 +51,12 @@ Rectangle::Rectangle (Group* parent, Rect const & rect)
|
||||||
void
|
void
|
||||||
Rectangle::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
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);
|
boost::optional<Rect> r = self.intersection (area);
|
||||||
|
|
||||||
if (!r) {
|
if (!r) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue