Skip to content

fix(screenshot): use devicePixelRatio for Windows Tauri DPI conversion#2947

Merged
abose merged 1 commit into
mainfrom
ss
May 28, 2026
Merged

fix(screenshot): use devicePixelRatio for Windows Tauri DPI conversion#2947
abose merged 1 commit into
mainfrom
ss

Conversation

@abose
Copy link
Copy Markdown
Member

@abose abose commented May 27, 2026

On Windows Tauri, use devicePixelRatio directly to convert getBoundingClientRect CSS pixels to physical pixels. This is more reliable than combining desktopZoomScale (from PhStore) with the OS DPI scale factor (from Tauri) separately, as those two values can disagree on some devices due to stale zoom state, multi-monitor DPI mismatches, or DPI compatibility shims.

macOS Tauri and Electron paths unchanged — they use desktopZoomScale since their capture APIs take logical coordinates.

On Windows Tauri, use devicePixelRatio directly to convert
getBoundingClientRect CSS pixels to physical pixels. This is more
reliable than combining desktopZoomScale (from PhStore) with the OS
DPI scale factor (from Tauri) separately, as those two values can
disagree on some devices due to stale zoom state, multi-monitor DPI
mismatches, or DPI compatibility shims.

macOS Tauri and Electron paths unchanged — they use desktopZoomScale
since their capture APIs take logical coordinates.
@sonarqubecloud
Copy link
Copy Markdown

@abose abose merged commit f4c2281 into main May 28, 2026
10 of 21 checks passed
@abose abose deleted the ss branch May 28, 2026 07:15
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.

1 participant