From 33543c7ebfa395a71f9a948bec28c6f775473f28 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Fri, 19 Jan 2024 18:36:19 +0800 Subject: [PATCH] fix: fix vertical bug. --- src/Ursa/Controls/RangeSlider/RangeTrack.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Ursa/Controls/RangeSlider/RangeTrack.cs b/src/Ursa/Controls/RangeSlider/RangeTrack.cs index 355a28f..aafabcd 100644 --- a/src/Ursa/Controls/RangeSlider/RangeTrack.cs +++ b/src/Ursa/Controls/RangeSlider/RangeTrack.cs @@ -499,10 +499,11 @@ public class RangeTrack: Control internal double GetRatioByPoint(double position) { bool isHorizontal = Orientation == Orientation.Horizontal; - var range = LowerSection?.Bounds.Width + InnerSection?.Bounds.Width + UpperSection?.Bounds.Width ?? double.Epsilon; + var range = isHorizontal? + LowerSection?.Bounds.Width + InnerSection?.Bounds.Width + UpperSection?.Bounds.Width ?? double.Epsilon + : LowerSection?.Bounds.Height + InnerSection?.Bounds.Height + UpperSection?.Bounds.Height ?? double.Epsilon; if (isHorizontal) { - if (IsDirectionReversed) { double trackStart = UpperThumb?.Bounds.Width/2 ?? 0;