summaryrefslogtreecommitdiff
path: root/src/tty/tty.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-30 23:54:30 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:14:45 -0300
commit65262f4a033d382426c7f58d57a9b38e45918558 (patch)
tree1648841704fe89f39e108fa4507864f12083f22d /src/tty/tty.zig
parent3975791ecb0a849a9b3beface1f9ef3ed9f0505f (diff)
downloadpardes-65262f4a033d382426c7f58d57a9b38e45918558.tar.gz
pardes-65262f4a033d382426c7f58d57a9b38e45918558.zip
A PDF page taller than one raster is drawn at the size it is shown, in bands around the screen, not squeezed into 4096 rows and blown up
The render geometry (pdf_bridge.c) clamped a page's LONGEST side to max_dimension: 4096 in the SDL policy, 1200 in Kitty's. A page 841.89 x 4818.9 pt, fit to a 1570 px wide pane, came out 715 x 4096 and was drawn 2.2 times too large at 1x, 4.4 times at 2x; Kitty's raster was 210 px wide. Every request now caps a raster ROW at max_dimension, and caps the height too only while that keeps the page at least as large as it is shown (RenderRequest.display_width/height, set from the fit). A tall page fit to width is rasterized at the pane's own width, in SDL, and at Kitty's 96 dpi as any other page is there. Such a page is not one buffer. A raster over 8192 rows (a texture's and Kitty's 10000-pixel limit) or over 64 MiB is banded (pdf_view.zig): its slot holds the rows on screen and a screenful either side, in 512-row chunks, and is rendered again, keeping the chunks it has, once the screen comes within half a screenful of its edge. Each chunk comes from its own render reaching 32 rows past both edges, so a row of the page is the same however it was scrolled to, and no chunk shows its clip edge: band rows are within 3 levels of a whole-page render (108 pixels of 45 million on the reported PDF). Highlights paint over the band's clean rows as over a page's, and the band uses the page's CTM, so search, selection and pointer geometry are unchanged. A display-list render now culls to the band (a scissor in page space). No pixel changes, but a frame that renders new rows of the reported page at 2x fell from 33-43 ms to 13-16 ms (pdf-scroll-bench, --cell 16x32). design.pdf's scroll-bench pixels are identical. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/tty/tty.zig')
0 files changed, 0 insertions, 0 deletions