Only send one SetSceneUnits call (#1981)

We only intended to send this once, at the start of execution. But the execute function is recursive, so it was sending many SetSceneUnits calls.

Fixes https://github.com/KittyCAD/modeling-app/issues/1971
This commit is contained in:
Adam Chalmers
2024-04-01 16:37:05 -05:00
committed by GitHub
parent f850f80de1
commit 76480f1a43
4 changed files with 17 additions and 7 deletions

View File

@ -41,7 +41,7 @@ async fn execute_and_snapshot(code: &str, units: kittycad::types::UnitLength) ->
let mut mem: kcl_lib::executor::ProgramMemory = Default::default();
let ctx = kcl_lib::executor::ExecutorContext::new(ws, units.clone()).await?;
let _ = kcl_lib::executor::execute(program, &mut mem, kcl_lib::executor::BodyType::Root, &ctx).await?;
let _ = kcl_lib::executor::execute_outer(program, &mut mem, kcl_lib::executor::BodyType::Root, &ctx).await?;
let (x, y) = kcl_lib::std::utils::get_camera_zoom_magnitude_per_unit_length(units);