ScatterPlotItem: implement hidpi pixmap#2863
Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom Nov 2, 2023
Merged
Conversation
Member
|
I think you can programatically get that ratio you need by doing the following inside the paint method dpi = self.getViewWidget().metric(QtGui.QPaintDevice.PaintDeviceMetric.PdmPhysicalDpiX)
pixmap_dpi = self.fragmentAtlas.pixmap.metric(QtGui.QPaintDevice.PaintDeviceMetric.PdmPhysicalDpiX)
scale = dpi / pixmap_dpiLikely don't want to be calling this during every paint call... |
Contributor
Author
Although we call it "hi-dpi", the quantity that we are interested in is the DPR rather than the DPI. |
Contributor
Author
Member
|
Thanks @pijyoi for the PR, this LGTM merging! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR came about while investigating #2854.
Although a workaround for #2854 was to disable
useCache, the true reason for the blurriness on hidpi displays is due to the pixmap atlas only being rendered at a dpi of 1.0.ScatterPlot.py,Symbol.pyexamples.ScatterPlotSpeedTest.py. i.e. there is a drawing penalty when a lo-res pixmap needs to be scaled to be painted onto a hidpi display.