aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-07-21 17:02:42 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2016-07-21 17:02:42 +0200
commitcf212350e80c880d1409bfb27221957856fc408c (patch)
tree487ec3841fa2e98e2a67b69c5052e232ac3561b9 /src/GraphicObjects
parent61f1561d972d077eed8df7e911038f8564f8ef17 (diff)
improve splitter mouse move
Diffstat (limited to 'src/GraphicObjects')
-rw-r--r--src/GraphicObjects/Splitter.cs28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/GraphicObjects/Splitter.cs b/src/GraphicObjects/Splitter.cs
index 527b4084..248863b5 100644
--- a/src/GraphicObjects/Splitter.cs
+++ b/src/GraphicObjects/Splitter.cs
@@ -82,15 +82,27 @@ namespace Crow
int ptrThis = gs.Children.IndexOf (this);
if (gs.Orientation == Orientation.Horizontal) {
- if (ptrThis >= 0)
- gs.Children [ptrThis - 1].Width = Math.Max(gs.Children [ptrThis - 1].Slot.Width + e.XDelta, 1);
- if (ptrThis < gs.Children.Count - 1)
- gs.Children [ptrThis + 1].Width = Math.Max(gs.Children [ptrThis + 1].Slot.Width - e.XDelta, 1);
+ if (ptrThis >= 0){
+ if (!gs.Children [ptrThis - 1].Width.IsFixed)
+ gs.Children [ptrThis - 1].Width = gs.Children [ptrThis - 1].Slot.Width;
+ gs.Children [ptrThis - 1].Width = Math.Max(gs.Children [ptrThis - 1].Width + e.XDelta, 1);
+ }
+ if (ptrThis < gs.Children.Count - 1){
+ if (!gs.Children [ptrThis + 1].Width.IsFixed)
+ gs.Children [ptrThis + 1].Width = gs.Children [ptrThis + 1].Slot.Width;
+ gs.Children [ptrThis + 1].Width = Math.Max(gs.Children [ptrThis + 1].Width - e.XDelta, 1);
+ }
} else {
- if (ptrThis >= 0)
- gs.Children [ptrThis - 1].Height = Math.Max(gs.Children [ptrThis - 1].Slot.Height + e.YDelta, 1);
- if (ptrThis < gs.Children.Count - 1)
- gs.Children [ptrThis + 1].Height = Math.Max(gs.Children [ptrThis + 1].Slot.Height - e.YDelta, 1);
+ if (ptrThis >= 0) {
+ if (!gs.Children [ptrThis - 1].Height.IsFixed)
+ gs.Children [ptrThis - 1].Height = gs.Children [ptrThis - 1].Slot.Height;
+ gs.Children [ptrThis - 1].Height = Math.Max (gs.Children [ptrThis - 1].Height + e.YDelta, 1);
+ }
+ if (ptrThis < gs.Children.Count - 1) {
+ if (!gs.Children [ptrThis + 1].Height.IsFixed)
+ gs.Children [ptrThis + 1].Height = gs.Children [ptrThis + 1].Slot.Height;
+ gs.Children [ptrThis + 1].Height = Math.Max (gs.Children [ptrThis + 1].Height - e.YDelta, 1);
+ }
}
}
public override bool UpdateLayout (LayoutingType layoutType)