diff options
Diffstat (limited to 'src/draw.zig')
| -rw-r--r-- | src/draw.zig | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/draw.zig b/src/draw.zig index 03bc0cf9..8503197c 100644 --- a/src/draw.zig +++ b/src/draw.zig @@ -133,7 +133,7 @@ pub fn place(p: *Pardes, s: *Surface) void { // frame's own time, not the stepped animations' 16 ms grid. A grid // snaps (it has no in-between), and so does nothing that shows it. const shown = lift != .off or inactiveDim(p) != 0; - const motion = animation.Motion.of(if (shown and builtins.capabilities.lift) p.settings.motion else .off); + const motion = animation.Motion.of(if (shown and builtins.frontend.lift) p.settings.motion else .off); // A flavour exaggerates what is only a few pixels (Motion.gain). spring.retarget(if (id == p.active) animation.Motion.of(p.settings.motion).gain else 0, p.now_ns, motion); _ = spring.step(p.now_ns); @@ -224,7 +224,7 @@ fn glideCursor(p: *Pardes, s: *Surface) void { s.chrome.cursor_glide = 0; s.chrome.cursor_alpha = 1; s.chrome.cursor_idle_ms = std.math.maxInt(u32); - if (!builtins.capabilities.lift) return; + if (!builtins.frontend.lift) return; const box = focusedCursorBox(p, s) orelse { // No cursor drawn (a PDF or picture took focus, a program hid its // own): a glide under way has nowhere to land, and its springs, @@ -1737,7 +1737,7 @@ test "a lift is sampled at each frame's own time, and asks for frames only while const p = try Pardes.init(std.testing.allocator, .{ .cols = 80, .rows = 24 }); defer p.deinit(); // A grid has no in-between: there a lift snaps. - if (!builtins.capabilities.lift) return error.SkipZigTest; + if (!builtins.frontend.lift) return error.SkipZigTest; _ = try p.setTestFile("text\n"); p.newScratchBelow(0); var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); @@ -1912,7 +1912,7 @@ test "with no lift, no dim and no motion a focus switch asks for no frames" { test "each Motion flavour reaches the lift as its own trajectory" { // A grid snaps; the flavours are a pixel shell's. - if (!builtins.capabilities.lift) return error.SkipZigTest; + if (!builtins.frontend.lift) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .cols = 80, .rows = 24 }); defer p.deinit(); _ = try p.setTestFile("text\n"); @@ -1951,7 +1951,7 @@ test "each Motion flavour reaches the lift as its own trajectory" { } test "the caret is its own body: a page leaves it still under the moving text, a wheel scroll lands its springs on its line's new row" { - if (!builtins.capabilities.lift) return error.SkipZigTest; + if (!builtins.frontend.lift) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .cols = 80, .rows = 30 }); defer p.deinit(); var text: std.ArrayList(u8) = .empty; @@ -1995,7 +1995,7 @@ test "the caret is its own body: a page leaves it still under the moving text, a } test "the focused cursor glides a jump, eases a step, the thin caret too, and is exact at rest" { - if (!builtins.capabilities.lift) return error.SkipZigTest; + if (!builtins.frontend.lift) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .cols = 80, .rows = 30 }); defer p.deinit(); _ = try p.setTestFile(std.mem.asBytes(&@as([20][20]u8, @splat("some text on a line\n".*)))); @@ -2078,7 +2078,7 @@ test "the focused cursor glides a jump, eases a step, the thin caret too, and is } test "a tag caret past its row's end glides to the tag's right edge, where the layer's is" { - if (!builtins.capabilities.lift) return error.SkipZigTest; + if (!builtins.frontend.lift) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .cols = 60, .rows = 16 }); defer p.deinit(); p.update(.{ .resize = .{ .cols = 60, .rows = 16, .row_metrics = .{ .body_w = 10, .body_h = 20, .tagline_w = 6, .tagline_h = 12 } } }); @@ -2128,7 +2128,7 @@ test "a tag caret past its row's end glides to the tag's right edge, where the l } test "a terminal's cursor lands with scrolling output, never gliding against it" { - if (!builtins.capabilities.lift or !pardes.terminal_panes) return error.SkipZigTest; + if (!builtins.frontend.lift or !pardes.terminal_panes) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .cols = 80, .rows = 12 }); defer p.deinit(); while (p.nextEffect()) |_| {} @@ -2323,7 +2323,7 @@ fn twoColumns(p: *Pardes, arena: *std.heap.ArenaAllocator) !void { } test "while its pane slides the cursor rides with it, at the same cell of the pane every frame" { - if (!builtins.capabilities.lift) return error.SkipZigTest; + if (!builtins.frontend.lift) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 20 }); defer p.deinit(); var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); @@ -2376,7 +2376,7 @@ test "while its pane slides the cursor rides with it, at the same cell of the pa } test "focus moved to another column glides from where the cursor was drawn" { - if (!builtins.capabilities.lift) return error.SkipZigTest; + if (!builtins.frontend.lift) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 20 }); defer p.deinit(); var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); @@ -2412,7 +2412,7 @@ test "focus moved to another column glides from where the cursor was drawn" { } test "a click that takes focus glides the cursor once, to where it lands on release" { - if (!builtins.capabilities.lift) return error.SkipZigTest; + if (!builtins.frontend.lift) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 20 }); defer p.deinit(); var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); @@ -2446,7 +2446,7 @@ test "a click that takes focus glides the cursor once, to where it lands on rele } test "focus moving to a pane with no cursor while the cursor glides lets the session go idle" { - if (!builtins.capabilities.lift) return error.SkipZigTest; + if (!builtins.frontend.lift) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 20 }); defer p.deinit(); var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); @@ -2475,7 +2475,7 @@ test "focus moving to a pane with no cursor while the cursor glides lets the ses } test "a pane focus reaches brightens on the same spring the one it leaves dims on, and Motion off snaps" { - if (!builtins.capabilities.lift) return error.SkipZigTest; + if (!builtins.frontend.lift) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .cols = 80, .rows = 24 }); defer p.deinit(); _ = try p.setTestFile(std.mem.asBytes(&@as([4][20]u8, @splat("some text on a line\n".*)))); |
