From b56c22ad826a49b7ea0013c1ca78cf64169fc326 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Tue, 2 Jun 2015 10:44:23 +0200 Subject: TemplatedControls, Picture objects for pixmap and svg raw data sharing among controls --- src/GraphicObjects/GenericStack.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/GraphicObjects/GenericStack.cs') diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs index f34e13d3..5759bac4 100644 --- a/src/GraphicObjects/GenericStack.cs +++ b/src/GraphicObjects/GenericStack.cs @@ -70,15 +70,19 @@ namespace go tmp.Width += c.Slot.Width + Spacing; tmp.Height = Math.Max (tmp.Height, c.Slot.Bottom); } + if (tmp.Width > 0) + tmp.Width -= Spacing; } else { foreach (GraphicObject c in Children) { tmp.Width = Math.Max (tmp.Width, c.Slot.Right); tmp.Height += c.Slot.Height + Spacing; } + if (tmp.Height > 0) + tmp.Height -= Spacing; } - tmp.Width += 2*Margin; - tmp.Height += 2*Margin; + tmp.Width += 2 * Margin; + tmp.Height += 2 * Margin; return tmp; } @@ -89,11 +93,13 @@ namespace go foreach (GraphicObject c in Children) { c.Slot.X = d; d += c.Slot.Width + Spacing; + c.RegisterForLayouting ((int)LayoutingType.Y); } } else { foreach (GraphicObject c in Children) { c.Slot.Y = d; d += c.Slot.Height + Spacing; + c.RegisterForLayouting ((int)LayoutingType.X); } } } -- cgit v1.3.1-4-g156e