Skip to content

Conversation

bojidar-bg
Copy link

@bojidar-bg bojidar-bg commented Jul 9, 2025

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.

BTW, this PR was made during a livestream, starting at 00:11:50. You can see me testing with ksnip around 01:30:21.

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