SpinEdit: only constrain Value if MaxValue is greater than MinValue

git-svn-id: trunk@38925 -
This commit is contained in:
bart 2012-09-30 21:04:36 +00:00
parent 0839a029db
commit 51374d258b

View File

@ -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;