]> git.mxchange.org Git - simgear.git/blobdiff - simgear/canvas/layout/Layout.cxx
canvas::Layout: support for contents margins.
[simgear.git] / simgear / canvas / layout / Layout.cxx
index 8ae4e6e88b76987436a73d2e62bf55547f50cba7..ee24be6e1853678768e5faf79e7766b2049307f5 100644 (file)
@@ -24,36 +24,6 @@ namespace simgear
 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)
   {
@@ -109,12 +79,11 @@ namespace canvas
   }
 
   //----------------------------------------------------------------------------
-  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;
   }
 
   //----------------------------------------------------------------------------