amwx / FluentAvalonia

Control library focused on fluent design and bringing more WinUI controls into Avalonia
MIT License
1.05k stars 97 forks source link

Slider Thumb Position is Incorrect for Value #496

Closed Omsad closed 10 months ago

Omsad commented 1 year ago

Describe the bug The slider thumb is positioned incorrectly e.g. not centred upon the ticks due to the margin of 2 on the left and right, see: Example 1

When declared as:

<Slider Value="0" TickFrequency="10" TickPlacement="TopLeft" />
<Slider Value="10" TickFrequency="10" TickPlacement="TopLeft" />
<Slider Value="20" TickFrequency="10" TickPlacement="TopLeft" />
<Slider Value="50" TickFrequency="10" TickPlacement="TopLeft" />

If you instead move the margin to the horizontal template, there is no clipping and the ticks now align with the thumb, see: Example 2

Desktop/Platform:

Additional context I have not tested this on anything other than windows, nor on a vertical slider.

The axaml changed: Style Change