Repository navigation
feat(render): crisper pages and a resolution-based 100% zoom with round zoom steps - #523
Merged
DutchSailor merged 2 commits intoOct 14, 2026
Conversation
…nd zoom steps Rendering - Zoom tiles are refined to the exact screen resolution once the view settles; between 150% and 300% a 300% coverage tile was shown shrunk by a non-integer factor, softening thin strokes. - The page bitmap and tiles are drawn on whole device pixels (rounded transform translation) so the canvas no longer blends every pixel with its neighbours at a fractional offset. - Continuous view renders each page at scale * devicePixelRatio and sizes the canvas from the bitmap, so it is drawn 1:1 instead of being resampled by a fraction of a pixel (blurry table rules and text). - New Page Display preference 'Page sharpening' (Off/Light/Medium/Strong/ Maximum, default Medium): a light 3x3 unsharp mask on fresh page and tile bitmaps for darker, crisper text. Changing it flushes the bitmap caches. Zoom - 100% is defined by a screen resolution preference (Page Display, default 110 dpi: 1 PDF point = dpi/72 CSS px) instead of 1 point = 1 px. The status bar shows/accepts the percentage in that unit and Actual Size uses it; the internal scale is unchanged. - Zoom buttons, keys, Ctrl+wheel and pinch (single-page and continuous view) step through round levels: 100, 125, 150, 200, 300, ...
Collaborator
Author
|
Hi @mojtabakarimi, when you have a moment, could you review this PR? I merged the latest main into the branch (the unit test list now lives in The main review points are the new 110 dpi default for 100% zoom (a preference; 96 gives browser size) and the continuous-view render path (now 1:1 at device resolution). Happy to adjust anything. Thanks! |
This was referenced Oct 14, 2026
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.
Summary
Makes page content look noticeably crisper at every zoom level and makes the zoom percentages behave like other PDF viewers.
Rendering
zoom * dprtile replaces it (tileNeedsExactRender).doc.scaleand shown in a canvas with a floored CSS size, so the bitmap was resampled by a fraction of a pixel (uneven grey table rules/text at most zoom levels, and upscaled by dpr on high-DPI screens). They now render atscale * devicePixelRatioand the canvas is sized from the bitmap (1:1).Zoom
doc.scale/viewport.zoom) is unchanged, so saved state and MCPapp_set_zoomkeep their meaning.Notes for review: the 110 dpi default changes what "100%" looks like for everyone (it is a preference; 96 gives browser size). New i18n keys are added for en/nl only, like the neighbouring Page Display keys.
Test plan
zoom-display(percent/scale conversion, dpi clamping, step ladder),render-sharpen(flat areas, edges, alpha, border),tileNeedsExactRendernpm run test:unitpasses;vite buildpasses