From 1b7b290e9a2a9ec77e13c2114ecdfef0ba0105f9 Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Fri, 26 Jul 2024 09:07:45 +0300 Subject: [PATCH] extra section length --- components/calcValues.vue | 5 ++++- components/model/item.vue | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/components/calcValues.vue b/components/calcValues.vue index f743167..67fb81e 100644 --- a/components/calcValues.vue +++ b/components/calcValues.vue @@ -101,10 +101,13 @@ const changeParametres = () => { if (full_sections == 0) { length = total_length_mm - fence_length - fence_length } + if ((total_length_mm - ((full_sections * length) + (full_sections * fence_length) + fence_length)) < fence_length) { + full_sections -= 1 + } } if (((full_sections * length) + (full_sections * fence_length) + fence_length) < total_length_mm) { - form_state.extra_section = total_length_mm - ((full_sections * length) + (full_sections * fence_length) + fence_length + fence_length) + form_state.extra_section = total_length_mm - ((full_sections * length) + (full_sections * fence_length) + fence_length) - fence_length } else { form_state.extra_section = 0 } diff --git a/components/model/item.vue b/components/model/item.vue index 301ebd8..764be08 100644 --- a/components/model/item.vue +++ b/components/model/item.vue @@ -36,7 +36,13 @@ onLoop(() => { if (Math.abs(point) >= Math.abs(target.value[element.axis as vectorType])) { step = 0 } - model.value[element.func](step) + if (model.value !== undefined && model.value[element.func] !== undefined && model.value.__tres) { + try { + model.value[element.func](step) + } catch (error) { + console.log('lvl 1') + } + } } } }); -- 2.40.1