mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-07 03:32:42 +02:00
* Add more rounding in SpinBox.qml, allowing FloatPreference::step to work reliably for the spinners without needing double precision (suggestion from ctrlaltdavid: https://github.com/vircadia/vircadia/pull/930#issuecomment-765838930).
* Change FloatPreference::step from double back to float.
This commit is contained in:
parent
da2a3f67cf
commit
a2e4b81ed8
3 changed files with 10 additions and 10 deletions
|
@ -73,9 +73,9 @@ SpinBox {
|
|||
}
|
||||
}
|
||||
|
||||
stepSize: realStepSize * factor
|
||||
to : realTo*factor
|
||||
from : realFrom*factor
|
||||
stepSize: Math.round(realStepSize * factor)
|
||||
to : Math.round(realTo*factor)
|
||||
from : Math.round(realFrom*factor)
|
||||
|
||||
font.family: "Fira Sans SemiBold"
|
||||
font.pixelSize: hifi.fontSizes.textFieldInput
|
||||
|
|
|
@ -466,7 +466,7 @@ void setupPreferences() {
|
|||
preference->setMin(1.0f);
|
||||
preference->setMax(2.2f);
|
||||
preference->setDecimals(2);
|
||||
preference->setStep(0.01);
|
||||
preference->setStep(0.01f);
|
||||
preferences->addPreference(preference);
|
||||
}
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ class FloatPreference : public Preference {
|
|||
Q_PROPERTY(float value READ getValue WRITE setValue NOTIFY valueChanged)
|
||||
Q_PROPERTY(float min READ getMin CONSTANT)
|
||||
Q_PROPERTY(float max READ getMax CONSTANT)
|
||||
Q_PROPERTY(double step READ getStep CONSTANT)
|
||||
Q_PROPERTY(float step READ getStep CONSTANT)
|
||||
Q_PROPERTY(uint decimals READ getDecimals CONSTANT)
|
||||
|
||||
public:
|
||||
|
@ -178,11 +178,11 @@ public:
|
|||
float getMax() const { return _max; }
|
||||
void setMax(float max) { _max = max; };
|
||||
|
||||
double getStep() const { return _step; }
|
||||
void setStep(double step) { _step = step; };
|
||||
float getStep() const { return _step; }
|
||||
void setStep(float step) { _step = step; };
|
||||
|
||||
uint getDecimals() const { return _decimals; }
|
||||
void setDecimals(uint decimals) { _decimals = decimals; };
|
||||
float getDecimals() const { return _decimals; }
|
||||
void setDecimals(float decimals) { _decimals = decimals; };
|
||||
|
||||
signals:
|
||||
void valueChanged();
|
||||
|
@ -197,7 +197,7 @@ protected:
|
|||
uint _decimals { 0 };
|
||||
float _min { 0 };
|
||||
float _max { 1 };
|
||||
double _step { 0.1 };
|
||||
float _step { 0.1f };
|
||||
};
|
||||
|
||||
class IntPreference : public Preference {
|
||||
|
|
Loading…
Reference in a new issue