summaryrefslogtreecommitdiff
path: root/src/surface.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 08:28:40 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commit0a2694e935fa8a79f1a399f2d2cbc643f8c3734e (patch)
tree994775a97465d4ad279a8b13b848a2368b9a430b /src/surface.zig
parent6f7c79650857da578b9e6f8c49c772eb7c40bcae (diff)
downloadpardes-0a2694e935fa8a79f1a399f2d2cbc643f8c3734e.tar.gz
pardes-0a2694e935fa8a79f1a399f2d2cbc643f8c3734e.zip
G13: Parallax, lapis's dots drift with the text at a quarter of its speed
Parallax on|off (off, a pixel shell's; Chrome.fx bit 3). A body region carries its first line (Region.line, a file's scroll or a terminal's grid offset; the wire's region record grows a u32). The GUI offsets each body's page dots by a quarter of its line in rows, and of G6's glide offset while one runs, so the pattern drifts with the text and settles with it; the cell shader reads it from the instance's serial slot, whose per-cell dissolve noise G7 left unused (the dead noise code goes). Tests: a scrolled body tells its line; the shift handed to the shader is a quarter of it within the dots' period. Measured in a capture: four lines move the dots 13 px (140 px / 4 mod 22). Gates as before, goldens byte-identical. Feel review: .scratch/render/parallax/.
Diffstat (limited to 'src/surface.zig')
-rw-r--r--src/surface.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/surface.zig b/src/surface.zig
index 02e4bb5d..d1ea78b1 100644
--- a/src/surface.zig
+++ b/src/surface.zig
@@ -370,6 +370,10 @@ pub const Region = struct {
/// focus (Lift, on a spring), a notice's while Lift is on. A pixel shell
/// casts a soft shadow from it; the tier it is drawn in never changes.
lift: f32 = 0,
+ /// A body's view: the first line it shows (a file's scroll, a
+ /// terminal's grid offset), for what a pixel shell moves with the text
+ /// (G13's parallax).
+ line: i32 = 0,
/// Cells the column-move rail takes off the right edge while it runs
/// there: layers and pixel shells stop short of them, the grid does not.
clip: u16 = 0,
@@ -451,7 +455,7 @@ pub const Chrome = struct {
/// A pixel shell's small effects: bit 0 a glow round the body's
/// selection (G9, SelectionGlow), bit 1 one under the word a look-hover
/// would open (G11, HoverGlow), bit 2 the bodies' edge shade (G12,
- /// Occlusion).
+ /// Occlusion), bit 3 the page pattern's parallax (G13, Parallax).
fx: u8 = 0,
};