c1e97b1e
scenario: polish — indent + RunContext geom comment
a73x 2026-04-19 14:08
Re-indents the scale_pending else-branch body one level deeper to match Zig's if/else convention; purely cosmetic. Documents RunContext's geometry snapshotting invariant so a future contributor adding a live-geom-read path knows to wire scale-change propagation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
diff --git a/src/main.zig b/src/main.zig index 629453e..898d80f 100644 --- a/src/main.zig +++ b/src/main.zig @@ -621,33 +621,33 @@ fn runTerminal(alloc: std.mem.Allocator, tick_ctx: ?*scenario_runtime.RunContext last_scale = current_scale; scale_pending = false; } else { vk_sync.waitIdleForShutdown(ctx.vkd, ctx.device); vk_sync.waitIdleForShutdown(ctx.vkd, ctx.device); geom = try rebuildFaceForScale( &face, &atlas, font_lookup.path, font_lookup.index, font_size, current_scale, ); cell_w = geom.cell_w_px; cell_h = geom.cell_h_px; baseline = geom.baseline_px; geom = try rebuildFaceForScale( &face, &atlas, font_lookup.path, font_lookup.index, font_size, current_scale, ); cell_w = geom.cell_w_px; cell_h = geom.cell_h_px; baseline = geom.baseline_px; // Wipe all cached row instances + mark the terminal fully dirty so that // every glyph gets re-inserted into the freshly reset atlas next frame. render_cache.invalidateAfterResize(); term.render_state.dirty = .full; // Wipe all cached row instances + mark the terminal fully dirty so that // every glyph gets re-inserted into the freshly reset atlas next frame. render_cache.invalidateAfterResize(); term.render_state.dirty = .full; window.surface.setBufferScale(geom.buffer_scale); window.surface.setBufferScale(geom.buffer_scale); const buf_w = window.width * @as(u32, @intCast(geom.buffer_scale)); const buf_h = window.height * @as(u32, @intCast(geom.buffer_scale)); try ctx.recreateSwapchain(buf_w, buf_h); const buf_w = window.width * @as(u32, @intCast(geom.buffer_scale)); const buf_h = window.height * @as(u32, @intCast(geom.buffer_scale)); try ctx.recreateSwapchain(buf_w, buf_h); last_scale = geom.buffer_scale; scale_pending = false; last_scale = geom.buffer_scale; scale_pending = false; } } diff --git a/src/scenario_runtime.zig b/src/scenario_runtime.zig index 8d73f4e..b8b16f3 100644 --- a/src/scenario_runtime.zig +++ b/src/scenario_runtime.zig @@ -46,6 +46,11 @@ pub const RunContext = struct { offscreen: ?*renderer.OffscreenTarget = null, face: ?*font.Face = null, atlas: ?*font.Atlas = null, /// Snapshotted at scenario-start from runTerminal's live geometry. /// Never updated even if the compositor changes scale mid-scenario — /// captures use the fixed offscreen target, so stale on-screen geom /// is inert. If you later add a path that re-reads live geom inside /// a capture, you MUST wire scale-change propagation here too. cell_w: u32 = 0, cell_h: u32 = 0, baseline: u32 = 0,