mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 00:22:01 +02:00
SpinEdit: only constrain Value if MaxValue is greater than MinValue
git-svn-id: trunk@38925 -
This commit is contained in:
parent
0839a029db
commit
51374d258b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user