diff --git a/Intersect.Client.Framework/Gwen/Control/LabeledSlider.cs b/Intersect.Client.Framework/Gwen/Control/LabeledSlider.cs index 20d4b670ea..56af960e26 100644 --- a/Intersect.Client.Framework/Gwen/Control/LabeledSlider.cs +++ b/Intersect.Client.Framework/Gwen/Control/LabeledSlider.cs @@ -378,7 +378,25 @@ 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) + { + if (min > Maximum) + { + Maximum = max; + Minimum = min; + } + else if (max < Minimum) + { + Minimum = min; + Maximum = max; + } + else + { + // Safe to set in either order + Minimum = min; + Maximum = max; + } + } public bool AutoSizeToContents { diff --git a/Intersect.Client.Framework/Gwen/Control/Slider.cs b/Intersect.Client.Framework/Gwen/Control/Slider.cs index f47fb7d4d4..4a7bbb8bc8 100644 --- a/Intersect.Client.Framework/Gwen/Control/Slider.cs +++ b/Intersect.Client.Framework/Gwen/Control/Slider.cs @@ -458,8 +458,22 @@ protected virtual void SetValueInternal(double newInternalValue, bool forceUpdat /// Maximum value. public void SetRange(double min, double max) { - _minimumValue = min; - _maximumValue = max; + if (min > Maximum) + { + _maximumValue = max; + _minimumValue = min; + } + else if (max < Minimum) + { + _minimumValue = min; + _maximumValue = max; + } + else + { + // Safe to set in either order + _minimumValue = min; + _maximumValue = max; + } } ///