mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-30 03:50:43 +02:00
gtk interface: improved rounding of floatspinedit value, fixes issue #12006
git-svn-id: trunk@19826 -
This commit is contained in:
parent
fdb51eba4c
commit
df85c2d5c1
@ -107,7 +107,10 @@ end;
|
||||
class function TGtkWSCustomFloatSpinEdit.GetValue(
|
||||
const ACustomFloatSpinEdit: TCustomFloatSpinEdit): Double;
|
||||
begin
|
||||
Result:=gtk_spin_button_get_value_as_float(PGtkSpinButton(ACustomFloatSpinEdit.Handle));
|
||||
Result := gtk_spin_button_get_value_as_float(PGtkSpinButton(ACustomFloatSpinEdit.Handle));
|
||||
// explicitly round to number of digits,
|
||||
// to prevent rounding errors from single to double
|
||||
Result:= RoundTo(Result, - ACustomFloatSpinEdit.DecimalPlaces);
|
||||
end;
|
||||
|
||||
class procedure TGtkWSCustomFloatSpinEdit.SetSelStart(const ACustomEdit: TCustomEdit;
|
||||
|
Loading…
Reference in New Issue
Block a user