diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-01-19 20:54:24 +0100 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-01-19 20:54:54 +0100 |
commit | 4fa4b9a1359131d861470376a34750211cf1a1ae (patch) | |
tree | 83d0395d654f9225c258456aa9e68b3ab334f945 /libs/canvas/grid.cc | |
parent | 758f183b99dadd173cc5b0f8b9e76f6cc3e02159 (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/grid.cc')
-rw-r--r-- | libs/canvas/grid.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/canvas/grid.cc b/libs/canvas/grid.cc index f6017fd9d6..02e18f79b8 100644 --- a/libs/canvas/grid.cc +++ b/libs/canvas/grid.cc @@ -73,7 +73,7 @@ Grid::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const void Grid::compute_bounding_box () const { - _bounding_box = boost::none; + _bounding_box = Rect(); if (_items.empty()) { _bounding_box_dirty = false; @@ -83,7 +83,7 @@ Grid::compute_bounding_box () const add_child_bounding_boxes (!collapse_on_hide); if (_bounding_box) { - Rect r = _bounding_box.get(); + Rect r = _bounding_box; _bounding_box = r.expand (outline_width() + top_margin, outline_width() + right_margin, @@ -152,7 +152,7 @@ Grid::reset_self () return; } - Rect r (_bounding_box.get()); + Rect r (_bounding_box); /* XXX need to shrink by margin */ @@ -195,7 +195,7 @@ Grid::reposition_children () continue; } - boost::optional<Rect> bb = (*i)->bounding_box(); + Rect bb = (*i)->bounding_box(); if (!bb) { continue; @@ -203,8 +203,8 @@ Grid::reposition_children () CoordsByItem::const_iterator c = coords_by_item.find (*i); - row_dimens[c->second.y] = max (row_dimens[c->second.y], bb.get().height()); - col_dimens[c->second.x] = max (col_dimens[c->second.x] , bb.get().width()); + row_dimens[c->second.y] = max (row_dimens[c->second.y], bb.height()); + col_dimens[c->second.x] = max (col_dimens[c->second.x] , bb.width()); } /* now sum the row and column widths, so that row_dimens is transformed |