summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 23:55:40 -0300
committerGabriel Schneider <[email protected]>2026-11-05 01:40:08 -0300
commit0aa470a350f913f12c9db3e18c5e80b5b74edfd6 (patch)
tree720c5e07e3467a0fcf657358acae1fb401048a18 /src
parent29e6f988ee392f5a7d7a7f1b007f3a33c2c43041 (diff)
downloadpardes-0aa470a350f913f12c9db3e18c5e80b5b74edfd6.tar.gz
pardes-0aa470a350f913f12c9db3e18c5e80b5b74edfd6.zip
gui: an instance's transition fields are written once: emitInstance no longer spells out the defaults CellInstance already has, and setTransitionFields with no track leaves a new instance as it is instead of zeroing it again
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui.zig30
1 files changed, 3 insertions, 27 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig
index 61bd61f0..63cee882 100644
--- a/src/gui/gui.zig
+++ b/src/gui/gui.zig
@@ -1873,6 +1873,8 @@ fn ndcBox(box: pardes.animation.Box, layout: CellLayout, win_w: f32, win_h: f32)
};
}
+/// A new instance's transition fields for `track`, which moves its pane;
+/// with none it keeps its defaults (still, all of it shown).
fn setTransitionFields(
instance: anytype,
track: ?pardes.animation.Track,
@@ -1881,21 +1883,7 @@ fn setTransitionFields(
win_h: f32,
cell_coord: u32,
) void {
- const active = track orelse {
- instance.panel_x0 = 0;
- instance.panel_y0 = 0;
- instance.panel_x1 = 0;
- instance.panel_y1 = 0;
- instance.present_x0 = 0;
- instance.present_y0 = 0;
- instance.present_x1 = 0;
- instance.present_y1 = 0;
- instance.effect = 0;
- instance.progress_bits = @bitCast(@as(f32, 1));
- instance.serial = 0;
- instance.cell_coord = cell_coord;
- return;
- };
+ const active = track orelse return;
const final = ndcBox(active.contentBox(), layout, win_w, win_h);
const presented = ndcBox(active.visualBox(), layout, win_w, win_h);
instance.panel_x0 = final[0];
@@ -7507,18 +7495,6 @@ fn emitInstance(
.br = @as(f32, @floatFromInt(resolved.bg[0])) / 255.0,
.bg = @as(f32, @floatFromInt(resolved.bg[1])) / 255.0,
.bb = @as(f32, @floatFromInt(resolved.bg[2])) / 255.0,
- .panel_x0 = 0,
- .panel_y0 = 0,
- .panel_x1 = 0,
- .panel_y1 = 0,
- .present_x0 = 0,
- .present_y0 = 0,
- .present_x1 = 0,
- .present_y1 = 0,
- .effect = 0,
- .progress_bits = @bitCast(@as(f32, 1)),
- .serial = 0,
- .cell_coord = 0,
};
setTransitionFields(
&instances[idx],