Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion Intersect.Client.Framework/Gwen/Control/LabeledSlider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,22 @@ protected override void OnChildSizeChanged(Base child, Point oldChildSize, Point
SizeToChildren(resizeX: AutoSizeToContentWidthOnChildResize, resizeY: AutoSizeToContentHeightOnChildResize);
}

public void SetRange(double min, double max) => (Minimum, Maximum) = (min, max);
public void SetRange(double min, double max)
{
var actualMin = Math.Min(min, max);
var actualMax = Math.Max(min, max);

if (actualMin > Maximum)
{
Maximum = actualMax;
Minimum = actualMin;
}
else
{
Minimum = actualMin;
Maximum = actualMax;
}
Comment on lines +386 to +395
Copy link
Member

@pandinocoder pandinocoder Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't take into account if actualMax < Minimum before setting Maximum = actualMax

}

public bool AutoSizeToContents
{
Expand Down
15 changes: 13 additions & 2 deletions Intersect.Client.Framework/Gwen/Control/Slider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,19 @@ protected virtual void SetValueInternal(double newInternalValue, bool forceUpdat
/// <param name="max">Maximum value.</param>
public void SetRange(double min, double max)
{
_minimumValue = min;
_maximumValue = max;
var actualMin = Math.Min(min, max);
var actualMax = Math.Max(min, max);

if (actualMin > Maximum)
{
_maximumValue = actualMax;
_minimumValue = actualMin;
}
else
{
_minimumValue = actualMin;
_maximumValue = actualMax;
}
Comment on lines +464 to +473
Copy link
Member

@pandinocoder pandinocoder Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't take into account if actualMax < Minimum before setting _maximumValue = actualMax

}

/// <summary>
Expand Down
Loading