-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fixed hatching in PatchCollection class #27937
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
base: main
Are you sure you want to change the base?
Changes from all commits
eba3d76
a563671
254f145
f0375b6
85cbdc7
f62a8ea
d8cf3a0
e1fe14d
a4275a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,7 +180,7 @@ def __init__(self, hatch, density): | |
|
||
|
||
def _validate_hatch_pattern(hatch): | ||
valid_hatch_patterns = set(r'-+|/\xXoO.*') | ||
valid_hatch_patterns = set(r'-+|/\xXoO.*').union({None}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do you need to add None if next line you only validate if not none? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the case of a list of Nones, the set function makes it into a singleton set with None. So it fails the if hatch is not None: condition There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, but then I think you don't need the |
||
if hatch is not None: | ||
invalids = set(hatch).difference(valid_hatch_patterns) | ||
if invalids: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how are new colors assigned if not passed in as part of the original patches?