mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 00:00:42 +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;
|
function TCustomFloatSpinEdit.GetLimitedValue(const AValue: Double): Double;
|
||||||
begin
|
begin
|
||||||
Result := AValue;
|
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
|
begin
|
||||||
if Result < FMinValue then Result := FMinValue;
|
if Result < FMinValue then Result := FMinValue;
|
||||||
if Result > FMaxValue then Result := FMaxValue;
|
if Result > FMaxValue then Result := FMaxValue;
|
||||||
|
Loading…
Reference in New Issue
Block a user