Skip to content

Commit

Permalink
fix: only remove knob transitions when dragging (#16993)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsimonsen authored Sep 12, 2024
1 parent 3858a72 commit e19850f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Avalonia.Controls/ToggleSwitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,14 @@ private void KnobsPanel_PointerMoved(object? sender, Input.PointerEventArgs e)
{
if (_knobsPanelPressed)
{
if(_knobsPanel != null)
{
_knobsPanel.Transitions = null;
}
var difference = e.GetPosition(_switchKnob) - _switchStartPoint;

if ((!_isDragging) && (System.Math.Abs(difference.X) > 3))
{
if (_knobsPanel != null)
{
_knobsPanel.Transitions = null;
}
_isDragging = true;
PseudoClasses.Set(":dragging", true);
}
Expand Down

0 comments on commit e19850f

Please sign in to comment.