From 5d8f54ac42419ea23161a1a53a8948360acdaf6a Mon Sep 17 00:00:00 2001 From: Dariusz Komosinski Date: Thu, 9 Jul 2020 23:12:05 +0200 Subject: [PATCH] Fix hardcoded thumb min length. --- src/Avalonia.Controls/Primitives/Track.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Avalonia.Controls/Primitives/Track.cs b/src/Avalonia.Controls/Primitives/Track.cs index c91adaa26e..29e7f28b44 100644 --- a/src/Avalonia.Controls/Primitives/Track.cs +++ b/src/Avalonia.Controls/Primitives/Track.cs @@ -353,6 +353,15 @@ namespace Avalonia.Controls.Primitives var trackLength = isVertical ? arrangeSize.Height : arrangeSize.Width; double thumbMinLength = 10; + StyledProperty minLengthProperty = isVertical ? MinHeightProperty : MinWidthProperty; + + var thumb = Thumb; + + if (thumb != null && thumb.IsSet(minLengthProperty)) + { + thumbMinLength = thumb.GetValue(minLengthProperty); + } + thumbLength = trackLength * viewportSize / extent; CoerceLength(ref thumbLength, trackLength); thumbLength = Math.Max(thumbMinLength, thumbLength);