From 8271b880e5e3510e832b3d7d243b99fa25e09b9a Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Tue, 23 Jul 2024 16:44:48 +0300 Subject: [PATCH] calc min --- components/calcValues.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/calcValues.vue b/components/calcValues.vue index 7ea9c6e..f183d24 100644 --- a/components/calcValues.vue +++ b/components/calcValues.vue @@ -51,7 +51,7 @@ const form_refs = { } const changeParametres = () => { - // console.log(form_state.total_length * 1000, copy_form_state.total_length * 1000) + console.log(form_state.total_length * 1000, copy_form_state.total_length * 1000) if ((form_state.total_length * 1000) <= (parametric.length.min + parametric.height.step)) { form_state.total_length = (parametric.length.min + parametric.height.step) / 1000 @@ -72,8 +72,8 @@ const changeParametres = () => { } } - if (form_state.total_length_mm < form_state.length) { - // form_state.length = form_state.total_length_mm + if (!form_state.auto_length && (form_state.length > form_state.total_length_mm)) { + form_state.length = form_state.total_length_mm } form_state.total_length_mm = form_state.total_length * 1000 @@ -83,7 +83,7 @@ const changeParametres = () => { if (auto_length) { let w = parametric.length.min const max_sections = Math.floor((total_length_mm - fence_length) / (parametric.length.min + fence_length)) - const min_sections = Math.floor((total_length_mm - fence_length) / (parametric.length.max + fence_length)) + const min_sections = Math.floor((total_length_mm - fence_length) / (parametric.length.max + fence_length)) || 1 for (let index = min_sections; index <= max_sections; index++) { full_sections = index -- 2.40.1