namespace canvas
{
- //----------------------------------------------------------------------------
- void Layout::update()
- {
- if( !(_flags & (LAYOUT_DIRTY | SIZE_INFO_DIRTY)) || !isVisible() )
- return;
-
- doLayout(_geometry);
-
- _flags &= ~LAYOUT_DIRTY;
- }
-
- //----------------------------------------------------------------------------
- void Layout::invalidate()
- {
- LayoutItem::invalidate();
- _flags |= LAYOUT_DIRTY;
- }
-
- //----------------------------------------------------------------------------
- void Layout::setGeometry(const SGRecti& geom)
- {
- if( geom != _geometry )
- {
- _geometry = geom;
- _flags |= LAYOUT_DIRTY;
- }
-
- update();
- }
-
//----------------------------------------------------------------------------
void Layout::removeItem(const LayoutItemRef& item)
{
}
//----------------------------------------------------------------------------
- void Layout::safeAdd(int& a, int b)
+ void Layout::contentsRectChanged(const SGRecti& rect)
{
- if( SGLimits<int>::max() - b < a )
- a = SGLimits<int>::max();
- else
- a += b;
+ doLayout(rect);
+
+ _flags &= ~LAYOUT_DIRTY;
}
//----------------------------------------------------------------------------