Repository navigation
v31: long worksheets no longer crawl on Mac (Retina) screens - #32
Merged
Merged
Conversation
The overlay drew ink on one canvas as tall as the whole worksheet. On a 2x screen a 20-page worksheet made that canvas about 22,000 pixels tall. Chrome can only hand a canvas up to 16,384 pixels to the graphics chip; past that it draws with the main processor, and each pen move took about a tenth of a second. The lab's 1x screens stayed under the limit, which is why the same file was fine there. Now the canvas is a band about three screens tall that follows the scrolling and redraws when it moves. Ink is saved in the same place as before, so existing ink lines up. Measured on the reported worksheet: drawing went from about 9 to 60 frames a second on a 2x screen. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #31
What was wrong: the overlay drew ink on one canvas as tall as the whole worksheet. On the MacBook's 2× (Retina) screen, the Resume Day 2 packet made that canvas 2940 × 21,888 pixels. Chrome can only give a canvas up to 16,384 pixels tall to the graphics chip; past that it falls back to the main processor, and every pen move took ~110 ms (about 9 frames a second). The lab HPs have 1× screens, so the same canvas was 10,944 px tall — under the limit, and smooth.
Measured in Chrome at 2×: a canvas exactly 16,384 px tall drew at 60 fps; 16,385 px dropped right away. The highlighter's blend mode made no difference.
The fix: the canvas is now a band about three screens tall that follows the scrolling, and redraws when you scroll near its edge (or before a stroke starts, after a big jump). It's capped under the graphics-chip limit, so ink stays full sharpness.
Checked on the reported worksheet (headless Chrome):
To get it into a worksheet: open the
_board.htmlfile in OverBoard again — it upgrades the overlay to v31 and keeps the ink saved inside it.Only the HTML overlay changed; the PDF app already uses one canvas per page, so it never hit this.
🤖 Generated with Claude Code