canvas: use Item::bb_clean() to mark _bounding_box_dirty false
This commit is contained in:
parent
5b123441f4
commit
ad6afbe68a
|
@ -64,7 +64,7 @@ Arc::compute_bounding_box () const
|
|||
bbox = bbox.expand (0.5 + (_outline_width / 2));
|
||||
|
||||
_bounding_box = bbox;
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -79,7 +79,7 @@ Arrow::compute_bounding_box () const
|
|||
_line->x1() + (head_width / 2.0) + outline_pad,
|
||||
_line->y1());
|
||||
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
|
||||
/** Set whether to show an arrow head at one end or other
|
||||
|
|
|
@ -77,7 +77,7 @@ Box::compute_bounding_box () const
|
|||
_bounding_box = Rect();
|
||||
|
||||
if (_items.empty()) {
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ Box::compute_bounding_box () const
|
|||
0.0);
|
||||
}
|
||||
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -159,7 +159,10 @@ public:
|
|||
virtual Duple intrinsic_size() const { return Duple (_intrinsic_width, _intrinsic_height); }
|
||||
virtual void set_intrinsic_size (Distance, Distance);
|
||||
|
||||
/** bounding box is the public API to get the size of the item.
|
||||
/** bounding box is the public API to get the area covered by the item
|
||||
* (which may differ from its allocation). The returned Rect is in item
|
||||
* coordinates (i.e. x0,y0 = 0,0 mean that the upper left corner of the
|
||||
* bounding box is at the item's _position).
|
||||
*/
|
||||
Rect bounding_box () const;
|
||||
|
||||
|
@ -326,6 +329,9 @@ public:
|
|||
mutable Rect _bounding_box;
|
||||
/** true if _bounding_box might be out of date, false if its definitely not */
|
||||
mutable bool _bounding_box_dirty;
|
||||
|
||||
void bb_clean () const;
|
||||
|
||||
Rect _allocation;
|
||||
bool _layout_sensitive;
|
||||
Distance _intrinsic_width;
|
||||
|
|
|
@ -92,7 +92,7 @@ void
|
|||
ConstraintPacker::compute_bounding_box () const
|
||||
{
|
||||
_bounding_box = _allocation;
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -88,7 +88,7 @@ Grid::compute_bounding_box () const
|
|||
_bounding_box = Rect();
|
||||
|
||||
if (_items.empty()) {
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ Grid::compute_bounding_box () const
|
|||
outline_width() + left_margin + left_padding);
|
||||
}
|
||||
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -69,7 +69,7 @@ void
|
|||
Image::compute_bounding_box () const
|
||||
{
|
||||
_bounding_box = Rect (0, 0, _width, _height);
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
|
||||
boost::shared_ptr<Image::Data>
|
||||
|
|
|
@ -1316,3 +1316,10 @@ Item::set_layout_sensitive (bool yn)
|
|||
{
|
||||
_layout_sensitive = yn;
|
||||
}
|
||||
|
||||
void
|
||||
Item::bb_clean () const
|
||||
{
|
||||
_bounding_box_dirty = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ Line::compute_bounding_box () const
|
|||
bbox = bbox.expand (0.5 + (_outline_width / 2));
|
||||
|
||||
_bounding_box = bbox;
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -71,7 +71,7 @@ LineSet::compute_bounding_box () const
|
|||
}
|
||||
}
|
||||
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -170,13 +170,13 @@ Meter::compute_bounding_box () const
|
|||
{
|
||||
if (!_canvas) {
|
||||
_bounding_box = Rect ();
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
return;
|
||||
}
|
||||
|
||||
Rect r (0, 0, pixwidth + 2, pixheight + 2);
|
||||
_bounding_box = r;
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ Pixbuf::compute_bounding_box () const
|
|||
_bounding_box = Rect ();
|
||||
}
|
||||
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -63,7 +63,7 @@ PolyItem::compute_bounding_box () const
|
|||
_bounding_box = Rect ();
|
||||
}
|
||||
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -176,10 +176,11 @@ void
|
|||
Rectangle::compute_bounding_box () const
|
||||
{
|
||||
if (!_rect.empty()) {
|
||||
// _bounding_box = _rect.fix().expand (1.0 + _outline_width * 0.5);
|
||||
_bounding_box = _rect.fix().expand (_outline_width * 0.5);
|
||||
}
|
||||
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -69,7 +69,7 @@ StepButton::compute_bounding_box () const
|
|||
|
||||
add_child_bounding_boxes ();
|
||||
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
|
||||
#define CORNER_RADIUS 5
|
||||
|
|
|
@ -239,7 +239,7 @@ Text::compute_bounding_box () const
|
|||
{
|
||||
if (!_canvas || _text.empty()) {
|
||||
_bounding_box = Rect ();
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -253,7 +253,7 @@ Text::compute_bounding_box () const
|
|||
_redraw ();
|
||||
}
|
||||
_bounding_box = Rect (0, 0, min (_clamped_width, (double) _image->get_width() * retina_factor), _image->get_height() * retina_factor);
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -143,5 +143,5 @@ Widget::compute_bounding_box () const
|
|||
|
||||
_widget.size_allocate (alloc);
|
||||
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ XFadeCurve::compute_bounding_box () const
|
|||
_bounding_box = Rect ();
|
||||
}
|
||||
|
||||
_bounding_box_dirty = false;
|
||||
bb_clean ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue