From 51374d258b6bf3ecec5b0bd0171ab4c7580d0af0 Mon Sep 17 00:00:00 2001 From: bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Sun, 30 Sep 2012 21:04:36 +0000 Subject: [PATCH] SpinEdit: only constrain Value if MaxValue is greater than MinValue git-svn-id: trunk@38925 - --- lcl/include/spinedit.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lcl/include/spinedit.inc b/lcl/include/spinedit.inc index a95c5801c2..8b632bb2f8 100644 --- a/lcl/include/spinedit.inc +++ b/lcl/include/spinedit.inc @@ -167,7 +167,9 @@ end; function TCustomFloatSpinEdit.GetLimitedValue(const AValue: Double): Double; begin Result := AValue; - if FMaxValue >= FMinValue then + //Delphi does not constrain when MinValue = MaxValue, and does if MaxValue > MinValue, + //but the latter makes absolutely no sense at all. + if FMaxValue > FMinValue then begin if Result < FMinValue then Result := FMinValue; if Result > FMaxValue then Result := FMaxValue;