From 3208a401b1a95234dc2e68a0ae97b9dae1158487 Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Wed, 3 Jul 2024 14:00:42 +0300 Subject: [PATCH] calc --- components/calcValues.vue | 3 +++ composables/useCalc.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/calcValues.vue b/components/calcValues.vue index 1957faf..9e5d040 100644 --- a/components/calcValues.vue +++ b/components/calcValues.vue @@ -94,6 +94,9 @@ const changeParametres = () => { length = w } else { full_sections = Math.floor((total_length_mm - fence_length) / (length + fence_length)) + if (full_sections == 0) { + length = total_length_mm - fence_length - fence_length + } } if (((full_sections * length) + (full_sections * fence_length) + fence_length) <= total_length_mm) { diff --git a/composables/useCalc.ts b/composables/useCalc.ts index d094dbf..5feb052 100644 --- a/composables/useCalc.ts +++ b/composables/useCalc.ts @@ -14,6 +14,6 @@ export const use_lamelle_color = () => useState('lamelle_color', () => export const use_section_count = () => useState('section_count', () => n) export const use_extra_section = () => useState('extra_section', () => 0) export const use_total_length = () => useState('total_length', () => ((min * n) - 100) * 0.001) -export const use_min_length = () => useState('min_length', () => 1000) +export const use_min_length = () => useState('min_length', () => 700) export const use_max_size = () => useState('max_size', () => 13) export const use_explosion_state = () => useState('explosion_state', () => false) \ No newline at end of file