diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-11-03 21:48:02 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-11-03 21:48:08 -0500 |
commit | f1e6b28ab7759f9bc93eb965cbe7740f1bafb2d3 (patch) | |
tree | f2403f8e8789787c2215a7899378fe1259084889 /libs | |
parent | 56994e785ec49f79e65b2e31535119d85c7100a0 (diff) |
use ArdourCanvas::TimeRectangle for regions, notes, markers
Diffstat (limited to 'libs')
-rw-r--r-- | libs/canvas/rectangle.cc | 21 | ||||
-rw-r--r-- | libs/canvas/wave_view.cc | 2 |
2 files changed, 12 insertions, 11 deletions
diff --git a/libs/canvas/rectangle.cc b/libs/canvas/rectangle.cc index c6381776e4..232da17893 100644 --- a/libs/canvas/rectangle.cc +++ b/libs/canvas/rectangle.cc @@ -255,17 +255,18 @@ void TimeRectangle::compute_bounding_box () const { Rectangle::compute_bounding_box (); - assert (_bounding_box); - Rect r = _bounding_box.get (); - - /* This is a TimeRectangle, so its right edge is drawn 1 pixel beyond - * (larger x-axis coordinates) than a normal Rectangle. - */ - - r.x1 += 1.0; /* this should be using safe_add() */ - - _bounding_box = r; + if (_bounding_box) { + Rect r = _bounding_box.get (); + + /* This is a TimeRectangle, so its right edge is drawn 1 pixel beyond + * (larger x-axis coordinates) than a normal Rectangle. + */ + + r.x1 += 1.0; /* this should be using safe_add() */ + + _bounding_box = r; + } } void diff --git a/libs/canvas/wave_view.cc b/libs/canvas/wave_view.cc index d67cf2c58f..aa857a8467 100644 --- a/libs/canvas/wave_view.cc +++ b/libs/canvas/wave_view.cc @@ -795,7 +795,7 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons return; } - Rect self = item_to_window (Rect (0.5, 0.0, _region->length() / _samples_per_pixel, _height)); + Rect self = item_to_window (Rect (0.0, 0.0, _region->length() / _samples_per_pixel, _height)); boost::optional<Rect> d = self.intersection (area); if (!d) { |