Support hatching in cairo backends.#27856
Merged
QuLogic merged 1 commit intomatplotlib:mainfrom Mar 15, 2024
Merged
Conversation
029aeac to
822eca8
Compare
timhoffm
approved these changes
Mar 14, 2024
QuLogic
reviewed
Mar 14, 2024
|
|
||
| def _set_rgba(ctx, color, alpha, forced_alpha): | ||
| if len(color) == 3 or forced_alpha: | ||
| ctx.set_source_rgba(*color, alpha) |
Member
There was a problem hiding this comment.
If the color is RGBA, then this could be incorrectly called with 5 arguments (RGBA color + alpha). The old code only used the first 3 elements of color. But perhaps that can never happen?
Contributor
Author
There was a problem hiding this comment.
Indeed, fixed. (We shoud really pin down what are the internal representations of colors at the renderer level, but that would be another project.)
Direct transposition of the mplcairo implementation (except for the lack of proper stacking, which was already present for the alpha state so it's not really "worse"), itself translated from the agg implementation.
QuLogic
approved these changes
Mar 15, 2024
Member
QuLogic
left a comment
There was a problem hiding this comment.
Seems to have worked in my testing.
Contributor
Author
|
I may just have gotten the new highscore for highest difference (in issue number or in time) between issue reported and closing PR :) |
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.
Closes #363. Try e.g.
plt.fill([0, 1, 0], hatch="/").Direct transposition of the mplcairo implementation (except for the lack of proper stacking noted in the comments, which was already present for the alpha state so it's not really "worse"), itself translated from the agg implementation.
No tests, but adding tests for the cairo backend would be another adventure.
PR summary
PR checklist