test calc

This commit is contained in:
Kseninia Mikhaylova 2024-06-10 10:35:20 +03:00
parent 464163ea2b
commit 60b42c39e5
1 changed files with 6 additions and 6 deletions

View File

@ -49,13 +49,13 @@ const changeParametres = () => {
form_state.total_length_mm = form_state.total_length * 1000 form_state.total_length_mm = form_state.total_length * 1000
if (auto_section_width.value) { if (auto_section_width.value) {
// form_state.length // form_state.length
if (form_state.total_length_mm % form_state.length) { // if (form_state.total_length_mm % form_state.length) {
let w = parametric.length.max let w = parametric.length.max
while ((form_state.total_length_mm % form_state.length > 0) && w > parametric.length.min) { while (((form_state.total_length_mm % w) > 0) && w > (parametric.length.min + parametric.length.step * 10)) {
w -= parametric.length.step w -= parametric.length.step
} }
form_state.length = w form_state.length = w
} // }
} }
if (form_state.total_length_mm < form_state.length) { if (form_state.total_length_mm < form_state.length) {