diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-09-07 16:19:58 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-09-07 16:19:58 +0200 |
| commit | 967f9bbeca46517f3d94d1eb4b04a3e36c8a31f0 (patch) | |
| tree | d6fb1e98074c85ecdb934c964da8418c16652baf /src/GraphicObjects/GenericStack.cs | |
| parent | ac08ff01dbc59628a94a6e09cd0aff07f588f05f (diff) | |
Dynamic layouting debug and improvments
Diffstat (limited to 'src/GraphicObjects/GenericStack.cs')
| -rw-r--r-- | src/GraphicObjects/GenericStack.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs index fc7aa247..2f9aede9 100644 --- a/src/GraphicObjects/GenericStack.cs +++ b/src/GraphicObjects/GenericStack.cs @@ -68,13 +68,13 @@ namespace go if (Orientation == Orientation.Horizontal) {
foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {
tmp.Width += c.Slot.Width + Spacing;
- tmp.Height = Math.Max (tmp.Height, c.Slot.Bottom);
+ tmp.Height = Math.Max (tmp.Height, Math.Max(c.Slot.Bottom, c.Slot.Height));
}
if (tmp.Width > 0)
tmp.Width -= Spacing;
} else {
foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {
- tmp.Width = Math.Max (tmp.Width, c.Slot.Right);
+ tmp.Width = Math.Max (tmp.Width, Math.Max(c.Slot.Right, c.Slot.Width));
tmp.Height += c.Slot.Height + Spacing;
}
if (tmp.Height > 0)
@@ -125,13 +125,13 @@ namespace go else if (gobjs.Length == 1) {
int sz = Children.Where(ch=>ch.Visible).Except (gobjs).Sum (g => g.Slot.Width);
if (sz < Slot.Width) {
- gobjs [0].Slot.Width = Slot.Width - sz - (Children.Count-1) * Spacing;
+ gobjs [0].Slot.Width = Slot.Width - sz - (Children.Count-1) * Spacing - 2 * Margin;
int idx = Children.IndexOf (gobjs [0]);
if (idx > 0 && idx < Children.Count - 1)
gobjs [0].Slot.Width -= Spacing;
if (gobjs [0].LastSlots.Width != gobjs [0].Slot.Width) {
gobjs [0].bmp = null;
- //gobjs [0].OnLayoutChanges (LayoutingType.Width);
+ gobjs [0].OnLayoutChanges (LayoutingType.Width);
gobjs [0].LastSlots.Width = gobjs [0].Slot.Width;
}
}
@@ -145,12 +145,13 @@ namespace go else if (gobjs.Length == 1) {
int sz = Children.Where(ch=>ch.Visible).Except (gobjs).Sum (g => g.Slot.Height);
if (sz < Slot.Height) {
- gobjs [0].Slot.Height = Slot.Height - sz- (Children.Count-1) * Spacing;
+ gobjs [0].Slot.Height = Slot.Height - sz- (Children.Count-1) * Spacing - 2 * Margin;
int idx = Children.IndexOf (gobjs [0]);
if (idx > 0 && idx < Children.Count - 1)
gobjs [0].Slot.Height -= Spacing;
if (gobjs [0].LastSlots.Height != gobjs [0].Slot.Height) {
gobjs [0].bmp = null;
+ gobjs [0].OnLayoutChanges (LayoutingType.Height);
gobjs [0].LastSlots.Height = gobjs [0].Slot.Height;
}
}
|