From: Jean-Philippe Bruyère Date: Wed, 26 Aug 2020 10:15:27 +0000 (+0200) Subject: debug splitter X-Git-Tag: v0.9.5-beta~113^2~3 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=6745ec4d738cb4f268bc7c221b6e96c51c2f4808;p=jp%2Fcrow.git debug splitter --- diff --git a/Crow/src/Widgets/Splitter.cs b/Crow/src/Widgets/Splitter.cs index 37502031..e9b74cd3 100644 --- a/Crow/src/Widgets/Splitter.cs +++ b/Crow/src/Widgets/Splitter.cs @@ -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);