mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-02 19:08:12 +08:00
fix increment ranges not drawing back immediately
This commit is contained in:
@@ -127,6 +127,10 @@
|
|||||||
|
|
||||||
// The simple `clamp()` function can't be used here since `undefined` values need to be boundless
|
// The simple `clamp()` function can't be used here since `undefined` values need to be boundless
|
||||||
let sanitized = value;
|
let sanitized = value;
|
||||||
|
if (mode == "Increment") {
|
||||||
|
if (typeof min === "number") sanitized = Math.max(sanitized, min);
|
||||||
|
if (typeof max === "number") sanitized = Math.min(sanitized, max);
|
||||||
|
}
|
||||||
text = displayText(sanitized, unit);
|
text = displayText(sanitized, unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,6 +142,11 @@
|
|||||||
let newValueValidated = newValue !== undefined ? newValue : oldValue;
|
let newValueValidated = newValue !== undefined ? newValue : oldValue;
|
||||||
|
|
||||||
if (newValueValidated !== undefined) {
|
if (newValueValidated !== undefined) {
|
||||||
|
if (mode == "Increment") {
|
||||||
|
if (typeof min === "number" && !Number.isNaN(min)) newValueValidated = Math.max(newValueValidated, min);
|
||||||
|
if (typeof max === "number" && !Number.isNaN(max)) newValueValidated = Math.min(newValueValidated, max);
|
||||||
|
}
|
||||||
|
|
||||||
if (isInteger) newValueValidated = Math.round(newValueValidated);
|
if (isInteger) newValueValidated = Math.round(newValueValidated);
|
||||||
|
|
||||||
rangeSliderValue = newValueValidated;
|
rangeSliderValue = newValueValidated;
|
||||||
|
|||||||
Reference in New Issue
Block a user