diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-24 15:20:26 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-24 15:35:35 -0300 |
| commit | 8a40a71e2eab06452ad55aacfeaf78a85586f3dd (patch) | |
| tree | d8e0f8227ae6d84f3b0c2998784328d3d3bd180b /dev/gui/gui.zig | |
| parent | a19eb53fa9ade764a1cf2e3c320cd34d50aa4106 (diff) | |
| download | pardes-8a40a71e2eab06452ad55aacfeaf78a85586f3dd.tar.gz pardes-8a40a71e2eab06452ad55aacfeaf78a85586f3dd.zip | |
gui: a picture is cut at its pane's right edge again: imageScissor's width is its placement's cells, as it was before 654a1632400a: that build (nvuylkxw, installed 2026-11-24 14:50) carried a throwaway line of the clip experiment (`+ 100000, // THROWAWAY: past any target`: every picture's clip run 100000 px past its width, so that SDL's scissor assertion could be met and the hold in sketchbook shown), restored in another workspace through `../pardes` from the shared sketchbook checkout and so kept in this one; held to the target by sketchbook's Cells.onTarget it asserted nothing, but a PDF page or an image wider than its pane drew over the panes to its right; no gate row has a picture past its pane's right edge (77 of 77 frames identical); TEST: gui.zig "a picture's scissor is its placement's cells, cut at its pane's edges" (fails on 654a1632400a: w 100040 for 40); the same change as yrslyomp on the multi-client line, put on main by itself for an install of its own
Co-Authored-By: Claude Opus <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'dev/gui/gui.zig')
| -rw-r--r-- | dev/gui/gui.zig | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig index 9ea813fc..aba74a94 100644 --- a/dev/gui/gui.zig +++ b/dev/gui/gui.zig @@ -3904,7 +3904,7 @@ fn imageScissor(g: *const Gui, place: pardes.Placement) c.SDL_Rect { return .{ .x = @intCast(@as(u32, place.dst.x) * g.cell_w), .y = @intCast(@as(u32, place.dst.y) * g.cell_h), - .w = @intCast(@as(u32, place.dst.w) * g.cell_w + 100000), // THROWAWAY: past any target + .w = @intCast(@as(u32, place.dst.w) * g.cell_w), .h = @intCast(@as(u32, place.dst.h) * g.cell_h), }; } @@ -7010,6 +7010,13 @@ test "a held key moves the view at the stream's own rate, never a bounce a line, for (70..90) |k| try std.testing.expectEqual(held.carets[70], held.carets[k]); } +test "a picture's scissor is its placement's cells, cut at its pane's edges" { + const g = testGui(10, 20, 6, 12); + var place: pardes.Placement = undefined; + place.dst = .{ .x = 2, .y = 3, .w = 4, .h = 5 }; + try std.testing.expectEqual(c.SDL_Rect{ .x = 20, .y = 60, .w = 40, .h = 100 }, imageScissor(&g, place)); +} + test "a scroll's shifted rows start under the context rows, and its scissor below their band" { var surface: pardes.Surface = .{}; var g = testGui(10, 20, 6, 12); |
