diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-06-18 08:23:06 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-06-18 08:23:06 -0400 |
commit | 77f5f4c4bf9074d953a1653658c8f96f38ae258c (patch) | |
tree | 08790670f6435eed917ab3f2629a0373652cbc1e /libs/canvas/image.cc | |
parent | a0c5de281a2ba029a9af53a6ffe3a717280998b3 (diff) |
basically operational switch to canvas drawing coordinates, although text and waves don't work, and redraw areas are too small
Diffstat (limited to 'libs/canvas/image.cc')
-rw-r--r-- | libs/canvas/image.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/canvas/image.cc b/libs/canvas/image.cc index b13859aeda..4a9bcdf8f1 100644 --- a/libs/canvas/image.cc +++ b/libs/canvas/image.cc @@ -43,10 +43,13 @@ Image::render (Rect const& area, Cairo::RefPtr<Cairo::Context> context) const _pending->stride); _current = _pending; } + + Rect self = item_to_window (Rect (0, 0, _width, _height)); + boost::optional<Rect> draw = self.intersection (area); - if (_surface) { + if (_surface && draw) { context->set_source (_surface, 0, 0); - context->rectangle (area.x0, area.y0, area.width(), area.height()); + context->rectangle (draw->x0, draw->y0, draw->width(), draw->height()); context->fill (); } } |