Skip to content

Fix zoom issue during copy paste in clipboard example #2158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arunjose696
Copy link

@arunjose696 arunjose696 commented May 16, 2025

Copy and paste no longer tries to autoscale the image. The image is always copied and pasted at 100% zoom.

The purpose of this change is to:

  1. Fix an issue in the clipboard example where the pasted image had different zoom levels across monitors
  2. Remove all calls to DPIUtil.get[Native]DeviceZoom()

Previously, when copying an image in the clipboard example, the image at the current zoom level was stored to clipboard using getImageDataAtCurrentZoom(). However, in normal Windows behavior (e.g., Paint), images are always copied at their original size regardless of the current zoom. When pasting, the image is pasted at 100% zoom, and the application handles zoom internally when displaying the image.

To match this behavior, copy and paste now always handle images at 100% scale, ignoring the current zoom and leaving zoom handling to the image class when it is fetched for display.

Copy link
Contributor

github-actions bot commented May 16, 2025

Test Results

   545 files  + 6     545 suites  +6   36m 37s ⏱️ + 7m 6s
 4 380 tests +37   4 362 ✅ +35   18 💤 +3  0 ❌  - 1 
16 650 runs  +37  16 509 ✅ +35  141 💤 +3  0 ❌  - 1 

Results for commit a80f142. ± Comparison against base commit 8b45dd8.

♻️ This comment has been updated with latest results.

… is always consumed at 100% zoom by copy, while doing the paste the zooms are set to 100
@arunjose696 arunjose696 marked this pull request as ready for review May 16, 2025 15:56
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.

Replace getDeviceZoom() call in ImageTransfer class
1 participant