Add support for blitting in qt5cairo.#17478
Merged
jklymak merged 1 commit intomatplotlib:masterfrom May 22, 2020
Merged
Conversation
tacaswell
approved these changes
May 21, 2020
Test with e.g. examples/event_handling/poly_editor.py. Doing the same for the other foocairo backends is left as an exercise to the reader.
Contributor
Author
|
edit: moved blit() to the Qt5 base class, avoiding duplication -- and now mplcairo can use it too. |
brunobeltran
approved these changes
May 21, 2020
Contributor
brunobeltran
left a comment
There was a problem hiding this comment.
LGTM (and runs correctly on my machine!)
jklymak
reviewed
May 22, 2020
| # repaint uses logical pixels, not physical pixels like the renderer. | ||
| l, b, w, h = [pt / self._dpi_ratio for pt in bbox.bounds] | ||
| t = b + h | ||
| self.repaint(l, self.rect().height() - t, w, h) |
Member
There was a problem hiding this comment.
OK, I can't find it - does qt5agg have a rect method? an is self.rect().height() equal to self.renderer.height / self._dpi_ratio?
Contributor
Author
There was a problem hiding this comment.
Yes, that comes to us from qt directly: https://doc.qt.io/qt-5/qwidget.html#rect-prop.
jklymak
approved these changes
May 22, 2020
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.
Test with e.g. examples/event_handling/poly_editor.py.
Doing the same for the other foocairo backends is left as an exercise to
the reader.
cf. #10187 (comment).
PR Summary
PR Checklist