]> O.S.I.I.S - jp/crow.git/commitdiff
resize also on 0 or itemindex-1
authorjpbruyere <jp.bruyere@hotmail.com>
Sat, 13 Feb 2016 13:35:28 +0000 (14:35 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Sat, 13 Feb 2016 13:35:28 +0000 (14:35 +0100)
src/GraphicObjects/Splitter.cs

index 09ff6d12af95348da75c91863c164c3abe361dfb..f3fdb34164169b92d7e1125e1502e92583d4d7d0 100644 (file)
@@ -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)