]> O.S.I.I.S - jp/crow.git/commitdiff
debug splitter
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 26 Aug 2020 10:15:27 +0000 (12:15 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 26 Aug 2020 10:15:27 +0000 (12:15 +0200)
Crow/src/Widgets/Splitter.cs

index 37502031c676d9b545db2662df018ce94580cf30..e9b74cd3867f8b369fc8ea0f29fc7a0f6e685485 100644 (file)
@@ -161,7 +161,7 @@ namespace Crow
                        if (init1 >= 0 && u1 == Unit.Percent) {
                                if (gs.Orientation == Orientation.Horizontal)
                                        go1.Width = new Measure ((int)Math.Ceiling (
-                                               go1.Width.Value * 100.0 / (double)gs.Slot.Width), Unit.Percent);
+                                               go1.Width.Value * 100.0 / (double)(gs.Slot.Width - 2 * gs.Margin)), Unit.Percent);
                                else
                                        go1.Height = new Measure ((int)Math.Ceiling (
                                                go1.Height.Value * 100.0 / (double)gs.Slot.Height), Unit.Percent);
@@ -169,7 +169,7 @@ namespace Crow
                        if (init2 >= 0 && u2 == Unit.Percent) {
                                if (gs.Orientation == Orientation.Horizontal)
                                        go2.Width = new Measure ((int)Math.Floor (
-                                               go2.Width.Value * 100.0 / (double)gs.Slot.Width), Unit.Percent);
+                                               go2.Width.Value * 100.0 / (double)(gs.Slot.Width - 2 * gs.Margin)), Unit.Percent);
                                else
                                        go2.Height = new Measure ((int)Math.Floor (
                                                go2.Height.Value * 100.0 / (double)gs.Slot.Height), Unit.Percent);