diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-24 15:20:26 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-24 15:36:53 -0300 |
| commit | f0b23904f81d261b4f80544bf3c5cc7aafbf440b (patch) | |
| tree | f6b6132a70231249a58587f15076efab9c4c3cc3 | |
| parent | 552400589c0514e8e3f9a9f96b23d2224302e1a7 (diff) | |
| download | pardes-f0b23904f81d261b4f80544bf3c5cc7aafbf440b.tar.gz pardes-f0b23904f81d261b4f80544bf3c5cc7aafbf440b.zip | |
gui: imageScissor is the placement's cells again: item 3's change (nvuylkxw, installed as 654a1632400a) kept a throwaway line of its own experiment (every picture's clip widened by 100000 px, to make SDL's scissor assertion fire on the test surface), restored in the wrong tree (a copy from inside the sketchbook checkout, whose ../pardes is ws-gate's): held to the target by sketchbook's Cells.onTarget it asserted nothing, but a picture was no longer cut at its pane's right edge (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/77 frames identical with it); TEST FIRST: gui.zig "a picture's scissor is its placement's cells, cut at its pane's edges" (expected 40, found 100040 on the installed line; passes now)
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| -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); |
