diff options
Diffstat (limited to 'src/GraphicObjects/Container.cs')
| -rw-r--r-- | src/GraphicObjects/Container.cs | 60 |
1 files changed, 28 insertions, 32 deletions
diff --git a/src/GraphicObjects/Container.cs b/src/GraphicObjects/Container.cs index c1134ec5..1971f00b 100644 --- a/src/GraphicObjects/Container.cs +++ b/src/GraphicObjects/Container.cs @@ -77,41 +77,37 @@ namespace go child.InvalidateLayout();
}
protected override Size measureRawSize ()
+ {
+ return child == null ? Bounds.Size : new Size(child.Slot.Width + 2 * (Margin),child.Slot.Height + 2 * (Margin));
+ }
+ public override void RegisterForLayouting ()
{
- Size raw = Bounds.Size;
-
- if (child != null) {
- if (Bounds.Width < 0 && child.WIsValid)
- raw.Width = child.Slot.Width + 2 * (Margin);
- if (Bounds.Height < 0 && child.HIsValid)
- raw.Height = child.Slot.Height + 2 * (Margin);
- }
+ base.RegisterForLayouting ();
- return raw;
+ if (child != null)
+ child.RegisterForLayouting ();
}
- public override void UpdateLayout()
- {
- if (LayoutIsValid)
- return;
-
- if (Width < 0 && child.Width == 0)
- child.Width = -1;
- if (Height < 0 && child.Height == 0)
- child.Height = -1;
-
- if (!(base.LayoutIsValid))
- base.UpdateLayout();
-
- if (child != null)
- {
- if (!child.LayoutIsValid) {
- child.UpdateLayout ();
- }
- }
-
- if (LayoutIsValid)
- registerForRedraw();
- }
+// public override void UpdateLayout (LayoutingType layoutType)
+// {
+//
+//// if (Width < 0 && child.Width == 0)
+//// child.Width = -1;
+//// if (Height < 0 && child.Height == 0)
+//// child.Height = -1;
+////
+//// if (!(base.LayoutIsValid))
+//// base.UpdateLayout();
+////
+//// if (child != null)
+//// {
+//// if (!child.LayoutIsValid) {
+//// child.UpdateLayout ();
+//// }
+//// }
+////
+//// if (LayoutIsValid)
+//// registerForRedraw();
+// }
public override Rectangle ContextCoordinates (Rectangle r)
{
return
|