Skip to content

Conversation

@fdcote
Copy link
Contributor

@fdcote fdcote commented Nov 8, 2025

This PR implements automatic DPI detection, ensuring that zoom percentage (after being entered with the zoom command) is always relative to the actual physical size of the content, regardless of which display the window is on.

Note: Due to the variability of display reporting in Linux, this feature is limited to macOS for now, until a general Linux solution is found.

@freref
Copy link
Owner

freref commented Nov 12, 2025

I'm not sure this is working as expected for me, whats the desired behavior when I set zoom to 100%? The picture below shows 100% zoom on my machine.
image

@fdcote
Copy link
Contributor Author

fdcote commented Nov 12, 2025

At 100% zoom, the document should appear on screen at its actual physical size (letter, A4, etc.). In other words, the output should match the size of a printed copy held up to the screen. The preview app in macOS adopts this behavior, so it's also possible to verify the expected size that way (at the same zoom level).

@freref
Copy link
Owner

freref commented Nov 12, 2025

Ok works for me, small nitpick: is there a reason we calculate the dpi every time we call setZoom as opposed to once when loading the config?

@fdcote
Copy link
Contributor Author

fdcote commented Nov 12, 2025

Yes. The reason is that the DPI could change if the window is moved to another display (in a multi-display setup).

@freref
Copy link
Owner

freref commented Nov 12, 2025

Makes sense, lovely work as always!

@freref freref merged commit f48d081 into freref:master Nov 12, 2025
4 checks passed
@fdcote fdcote deleted the DPI branch November 17, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants