From: jpbruyere Date: Sat, 13 Feb 2016 13:35:28 +0000 (+0100) Subject: resize also on 0 or itemindex-1 X-Git-Tag: v0.4~127^2~30 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=5d8196e1b40d46cb23f775533f47bc968e0e26de;p=jp%2Fcrow.git resize also on 0 or itemindex-1 --- 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)