From ee5f2b52eb3fea7ae25ebc14abf0ac8898cca676 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Tue, 5 Dec 2023 21:20:01 +0100 Subject: [PATCH] fix: fix output of minimum_cruise_ratio Signed-off-by: Stefan Dej --- src/components/panels/MachineSettings/MotionSettings.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/panels/MachineSettings/MotionSettings.vue b/src/components/panels/MachineSettings/MotionSettings.vue index d2925e846..315290a08 100644 --- a/src/components/panels/MachineSettings/MotionSettings.vue +++ b/src/components/panels/MachineSettings/MotionSettings.vue @@ -117,8 +117,12 @@ export default class MotionSettings extends Mixins(BaseMixin) { return Math.trunc(this.$store.state.printer?.toolhead?.max_accel_to_decel ?? this.accel / 2) } - get minimumCruiseRatio(): number { - return this.$store.state.printer?.toolhead?.minimum_cruise_ratio ?? null + get minimumCruiseRatio(): number | null { + const value = this.$store.state.printer?.toolhead?.minimum_cruise_ratio ?? null + + if (value === null) return null + + return Math.round(value * 100) / 100 } get squareCornerVelocity(): number {