Skip to content

Fix result images being rescaled on HDPI monitors #342

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

bojidar-bg
Copy link

Currently, in Gwenview (which uses kImageAnnotator), when using the annotate feature on devices with Display Scaling enabled, the resulting image gets rescaled as well; e.g. if one starts annotating a 10x10 image on a 125%-scaled monitor, they would get a 20x20 image after annotating: KDE bug 485066

I considered changing the pixel ratio of the image coming from Gwenview in https://github.com/KDE/gwenview/blob/fa8a60a7988504feafe78c4d39c2ad362b31ad56/lib/annotate/annotatedialog.cpp#L53 to match the device pixel ratio instead, however doing so ends up adding a border of white pixels around odd-sized images (e.g. 11x11 becomes 12x12), and also doubles annotation sizes (e.g. 3-width pencil tool ends up taking 4 pixels).

I also tested this change with ksnip (with the xdg-portal based grabber), and it seemed to work fine as long as "scale generic wayland screenshots" is enabled.

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