summaryrefslogtreecommitdiff
path: root/src/Presentation.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-21 17:25:52 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:15 -0300
commit23518c9d7c061f8a06f6632da8b64b37801b514f (patch)
tree1f9688a5c2b2c224f47dd538ffab275b1f54da5c /src/Presentation.zig
parentbc3d18d27f9fc1155db7fac3946c4d38774f9e65 (diff)
downloadpardes-23518c9d7c061f8a06f6632da8b64b37801b514f.tar.gz
pardes-23518c9d7c061f8a06f6632da8b64b37801b514f.zip
zig fmt for Zig 0.17
Diffstat (limited to 'src/Presentation.zig')
-rw-r--r--src/Presentation.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Presentation.zig b/src/Presentation.zig
index 5cec73e0..2a75b66d 100644
--- a/src/Presentation.zig
+++ b/src/Presentation.zig
@@ -226,7 +226,7 @@ fn stamp(p: *const Pardes, track: Track) Track {
switch (track.effect) {
.slide, .zoom, .vertical => {
const motion = animation.Motion.of(p.settings.motion);
- stamped.motion = @intFromEnum(p.settings.motion) + 1;
+ stamped.motion = @backingInt(p.settings.motion) + 1;
stamped.frame_count = @intFromFloat(@max(2, @round(@as(f32, @floatFromInt(track.effect.frames())) * motion.span)));
},
else => {},
@@ -741,7 +741,7 @@ test "a pane past its mark never takes a neighbour's click" {
// Bouncy, at its peak: pane 0 slides right to 0..40 and swings past it,
// over the neighbour at 40..80.
var presentation: Presentation = .{};
- var track: Track = .{ .serial = 7, .effect = .slide, .motion = @intFromEnum(animation.Motion.Flavour.bouncy) + 1, .frame_count = 20, .from = .{ .x = -40, .y = 0, .w = 40, .h = 20 }, .to = .{ .x = 0, .y = 0, .w = 40, .h = 20 } };
+ var track: Track = .{ .serial = 7, .effect = .slide, .motion = @backingInt(animation.Motion.Flavour.bouncy) + 1, .frame_count = 20, .from = .{ .x = -40, .y = 0, .w = 40, .h = 20 }, .to = .{ .x = 0, .y = 0, .w = 40, .h = 20 } };
var peak: u16 = 0;
var furthest: f32 = -1e9;
while (track.frame < track.frames()) : (track.frame += 1) {
@@ -807,7 +807,7 @@ test "presentation snapshots own compact body and tag rows across later edits" {
}
test "a move retargeted mid-way carries its speed into the new one" {
- const smooth = @intFromEnum(animation.Motion.Flavour.smooth) + 1;
+ const smooth = @backingInt(animation.Motion.Flavour.smooth) + 1;
const first: Track = .{ .serial = 1, .phase = .moving, .effect = .slide, .motion = smooth, .frame = 4, .frame_count = 14, .from = .{ .x = 0, .y = 1, .w = 40, .h = 20 }, .to = .{ .x = 40, .y = 1, .w = 40, .h = 20 } };
const was = first.velocity();
try std.testing.expect(was.x > 0.5);