Skip to content

fix: paint method widget argument can be None#2903

Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom
pijyoi:fix-paint-no-widget
Feb 14, 2024
Merged

fix: paint method widget argument can be None#2903
j9ac9k merged 1 commit intopyqtgraph:masterfrom
pijyoi:fix-paint-no-widget

Conversation

@pijyoi
Copy link
Copy Markdown
Contributor

@pijyoi pijyoi commented Dec 16, 2023

This PR fixes a bug introduced in #2863.
In the paint method, the DPR is obtained by calling widget.devicePixelRatioF(). However, the widget argument can be None. https://doc.qt.io/qt-6/qgraphicsitem.html#paint

This bug manifests itself at least in the Jupyter Notebook examples using ScatterPlotItem.

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Feb 14, 2024

walrus operator has entered the codebase!

Thanks @pijyoi sorry it's taken me so long to get to this. This LGTM, I appreciate your continued work and effort on this library!

@j9ac9k j9ac9k merged commit 562f60c into pyqtgraph:master Feb 14, 2024
@pijyoi pijyoi deleted the fix-paint-no-widget branch February 14, 2024 11:34
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.

2 participants