mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Simplify normalization formula.
This commit is contained in:
parent
c14539d63a
commit
1a189ba4f5
2 changed files with 2 additions and 10 deletions
|
@ -68,11 +68,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizeValue(value) {
|
function normalizeValue(value) {
|
||||||
if (value > sliderRoot.maximumValue)
|
return Math.min(Math.max(value, sliderRoot.minimumValue), sliderRoot.maximumValue)
|
||||||
return sliderRoot.maximumValue
|
|
||||||
else if (value < sliderRoot.minimumValue)
|
|
||||||
return sliderRoot.minimumValue
|
|
||||||
return value
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// slider track
|
// slider track
|
||||||
|
|
|
@ -49,11 +49,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizeValue(value) {
|
function normalizeValue(value) {
|
||||||
if (value > sliderRoot.maximumValue)
|
return Math.min(Math.max(value, sliderRoot.minimumValue), sliderRoot.maximumValue)
|
||||||
return sliderRoot.maximumValue
|
|
||||||
else if (value < sliderRoot.minimumValue)
|
|
||||||
return sliderRoot.minimumValue
|
|
||||||
return value
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// slider track
|
// slider track
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue