summaryrefslogtreecommitdiff
path: root/libs/canvas/scroll_group.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2017-01-19 20:54:24 +0100
committerPaul Davis <paul@linuxaudiosystems.com>2017-01-19 20:54:54 +0100
commit4fa4b9a1359131d861470376a34750211cf1a1ae (patch)
tree83d0395d654f9225c258456aa9e68b3ab334f945 /libs/canvas/scroll_group.cc
parent758f183b99dadd173cc5b0f8b9e76f6cc3e02159 (diff)
remove use of boost::optional to define "undefined" Canvas::Rect, and use Rect::empty instead.
This commit includes Rect::operator bool() which might be a candidate for removal in a future commit, in an attempt to make the meaning clearer
Diffstat (limited to 'libs/canvas/scroll_group.cc')
-rw-r--r--libs/canvas/scroll_group.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/libs/canvas/scroll_group.cc b/libs/canvas/scroll_group.cc
index 9e7732b8d2..64b5bee1c9 100644
--- a/libs/canvas/scroll_group.cc
+++ b/libs/canvas/scroll_group.cc
@@ -46,16 +46,16 @@ ScrollGroup::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) c
* WITHOUT scroll offsets in effect
*/
- boost::optional<Rect> r = bounding_box();
+ Rect r = bounding_box();
if (!r) {
return;
}
- Rect self (_position.x + r.get().x0,
- _position.y + r.get().y0,
- _position.x + r.get().x1,
- _position.y + r.get().y1);
+ Rect self (_position.x + r.x0,
+ _position.y + r.y0,
+ _position.x + r.x1,
+ _position.y + r.y1);
self.x1 = min (_position.x + _canvas->width(), self.x1);
self.y1 = min (_position.y + _canvas->height(), self.y1);
@@ -84,7 +84,7 @@ ScrollGroup::scroll_to (Duple const& d)
bool
ScrollGroup::covers_canvas (Duple const& d) const
{
- boost::optional<Rect> r = bounding_box ();
+ Rect r = bounding_box ();
if (!r) {
return false;
@@ -95,13 +95,13 @@ ScrollGroup::covers_canvas (Duple const& d) const
within the canvas.
*/
- return r->translate (position()).contains (d);
+ return r.translate (position()).contains (d);
}
bool
ScrollGroup::covers_window (Duple const& d) const
{
- boost::optional<Rect> r = bounding_box ();
+ Rect r = bounding_box ();
if (!r) {
return false;
@@ -112,5 +112,5 @@ ScrollGroup::covers_window (Duple const& d) const
within the canvas.
*/
- return r->translate (position()).contains (d);
+ return r.translate (position()).contains (d);
}