MCPcopy Create free account
hub / github.com/PerroEngine/Perro / save_recent_projects

Function save_recent_projects

perro_editor/res/scripts/ui/editor_ui.rs:4926–4934  ·  view source on GitHub ↗
(recent: &[String])

Source from the content-addressed store, hash-verified

4924
4925pub fn apply_viewport_canvas<API: ScriptAPI + ?Sized>(ctx: &mut ScriptContext<'_, API>) {
4926 let window_aspect = viewport_window_aspect(ctx);
4927 // Runs every frame in UI + 2D mode. Compare the inputs first so an idle
4928 // frame skips ~20 node lookups and the per-line name formatting.
4929 let (mode, pan_x, pan_y, zoom, layout, unchanged) =
4930 with_state_mut!(ctx.run, EditorState, ctx.id, |state| {
4931 let (pan_x, pan_y, zoom) = if state.viewport_mode == "2D" {
4932 let zoom = state.cam2_zoom.max(0.05);
4933 (-state.cam2_x * zoom / 960.0, state.cam2_y * zoom / 540.0, zoom)
4934 } else {
4935 (0.0, 0.0, state.ui_canvas_zoom.max(0.25))
4936 };
4937 let layout_key = (state.bottom_dock_open as u32)

Callers 2

add_recent_projectFunction · 0.85
load_recent_projectsFunction · 0.85

Calls 3

joinMethod · 0.80
save_stringFunction · 0.50
iterMethod · 0.45

Tested by

no test coverage detected