aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-13 14:35:28 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-13 14:35:28 +0100
commit5d8196e1b40d46cb23f775533f47bc968e0e26de (patch)
tree97e6f5a44f42024d0be545e8cf6b3f4d3576089f /src/GraphicObjects
parent49a890470cd28968d6d4d559bdd620b56afe6b5e (diff)
resize also on 0 or itemindex-1
Diffstat (limited to 'src/GraphicObjects')
-rw-r--r--src/GraphicObjects/Splitter.cs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/GraphicObjects/Splitter.cs b/src/GraphicObjects/Splitter.cs
index 09ff6d12..f3fdb341 100644
--- a/src/GraphicObjects/Splitter.cs
+++ b/src/GraphicObjects/Splitter.cs
@@ -80,15 +80,16 @@ namespace Crow
GenericStack gs = Parent as GenericStack;
int ptrThis = gs.Children.IndexOf (this);
- if (ptrThis == 0 || ptrThis == gs.Children.Count - 1)
- return;
-
if (gs.Orientation == Orientation.Horizontal) {
- gs.Children [ptrThis - 1].Width = Math.Max(gs.Children [ptrThis - 1].Slot.Width + e.XDelta*2, 1);
- gs.Children [ptrThis + 1].Width = Math.Max(gs.Children [ptrThis + 1].Slot.Width - e.XDelta*2, 1);
+ if (ptrThis >= 0)
+ gs.Children [ptrThis - 1].Width = Math.Max(gs.Children [ptrThis - 1].Slot.Width + e.XDelta*2, 1);
+ if (ptrThis < gs.Children.Count - 1)
+ gs.Children [ptrThis + 1].Width = Math.Max(gs.Children [ptrThis + 1].Slot.Width - e.XDelta*2, 1);
} else {
- gs.Children [ptrThis - 1].Height = Math.Max(gs.Children [ptrThis - 1].Slot.Height + e.YDelta*2, 1);
- gs.Children [ptrThis + 1].Height = Math.Max(gs.Children [ptrThis + 1].Slot.Height - e.YDelta*2, 1);
+ if (ptrThis >= 0)
+ gs.Children [ptrThis - 1].Height = Math.Max(gs.Children [ptrThis - 1].Slot.Height + e.YDelta*2, 1);
+ if (ptrThis < gs.Children.Count - 1)
+ gs.Children [ptrThis + 1].Height = Math.Max(gs.Children [ptrThis + 1].Slot.Height - e.YDelta*2, 1);
}
}
public override bool UpdateLayout (LayoutingType layoutType)