Skip to content
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

Enable high-dpi support for plots #55

Merged
merged 1 commit into from Apr 15, 2022
Merged

Conversation

akenmorris
Copy link
Contributor

This PR enables higher resolution plots for high-dpi devices that do not use a 1.0 device pixel ratio. The issue is described well here:

https://stackoverflow.com/questions/42011410/qt-drawing-high-dpi-qpixmaps

The problem is that JKQtPlotter, like this example, is drawing to an offscreen QImage based on the "size" of the widget. However, a high-dpi display like a Mac Retina display will report half the actual size (e.g. 400x400 instead of 800x800) since these display units are given at the non-high-dpi scale.

Before:

before

After:

after

I can't say that I've done very extensive testing with these changes, but they have been suitable for my uses.

@sim186
Copy link

sim186 commented Apr 7, 2022

Hi! Is this already part of the latest release? If not how can I get your contribution?

@akenmorris
Copy link
Contributor Author

Doesn't appear to have been merged. You can get it here:

https://github.com/akenmorris/JKQtPlotter/tree/high_dpi

@jkriege2 jkriege2 merged commit 8f18479 into jkriege2:master Apr 15, 2022
@jkriege2
Copy link
Owner

Thanks for this fix ... and sorry it took so long (I've been unable to tend to this lib for the last two years due to personal reasons!)

@akenmorris
Copy link
Contributor Author

No problem. Thanks for the amazing library! We are using it in ShapeWorks, e.g. :

http://sciinstitute.github.io/ShapeWorks/6.3/studio/getting-started-with-studio.html#metrics-panel

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.

None yet

3 participants