From 5d8196e1b40d46cb23f775533f47bc968e0e26de Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Sat, 13 Feb 2016 14:35:28 +0100 Subject: [PATCH] resize also on 0 or itemindex-1 --- src/GraphicObjects/Splitter.cs | 15 ++++++++------- 1 file 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) -- 2.47.3