X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fcanvas%2Frectangle.cc;h=06a41e074c0fe6514c58b40ca12b7cdfc4778bb3;hb=6d4c0baad3a09d43b5eacb37ea2a2e4c31afcec6;hp=7b7f67c3c6b979836f5d11aac38841e6ab2ffe57;hpb=c235d3da994aba4febd644afa09bd5c836c050d5;p=ardour.git diff --git a/libs/canvas/rectangle.cc b/libs/canvas/rectangle.cc index 7b7f67c3c6..06a41e074c 100644 --- a/libs/canvas/rectangle.cc +++ b/libs/canvas/rectangle.cc @@ -119,11 +119,19 @@ Rectangle::render (Rect const & area, Cairo::RefPtr context) con void Rectangle::compute_bounding_box () const { - /* boundary is drawn inside our coordinates but expanded by 0.5 to get - * single-pixel drawing correct. - */ - Rect r = _rect.fix(); - _bounding_box = boost::optional (r.expand (_outline_width/2.0)); + if (!_rect.empty()) { + Rect r = _rect.fix (); + + /* our outlines are always inside our coordinates, but we have + * to ensure that our bounding box fully *contains* the + * rectangle + * + * XXX: or something like that, waffle. + * + */ + _bounding_box = r.expand (1.0); + } + _bounding_box_dirty = false; }