Fix rotation input (#472)

This commit is contained in:
0HyperCube
2022-01-08 21:06:15 +00:00
committed by Keavon Chambers
parent 71f2f13989
commit c374d5b4f3

View File

@@ -268,7 +268,11 @@ export default defineComponent({
return;
}
const sanitized = clamp(newValue, this.min, this.max);
// We cannot use the clamp function here as we need undifined values to lead to no clamp.
let sanitized = newValue;
if (typeof this.min === "number") sanitized = Math.max(sanitized, this.min);
if (typeof this.max === "number") sanitized = Math.min(sanitized, this.max);
this.setText(sanitized);
},