-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Prefer to the GraphicsContext public API when possible. #8848
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
Prefer to the GraphicsContext public API when possible. #8848
Conversation
The appveyor failures are un-related (see #8849 ) |
lib/matplotlib/backend_bases.py
Outdated
@@ -1164,7 +1165,7 @@ def get_sketch_params(self): | |||
""" | |||
return self._sketch | |||
|
|||
def set_sketch_params(self, scale=None, length=None, randomness=None): | |||
def set_sketch_params(self, scale=None, length=128, randomness=16): |
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.
This is a slight change of behavior in that anything 'falsy' would give the default behavior. My guess is that this was not intended.
This came in via #1329 which has lots of discussion around it.
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.
The simplification to set_sktech_params
should be reverted please.
lib/matplotlib/backend_bases.py
Outdated
@@ -1164,7 +1165,7 @@ def get_sketch_params(self): | |||
""" | |||
return self._sketch | |||
|
|||
def set_sketch_params(self, scale=None, length=None, randomness=None): | |||
def set_sketch_params(self, scale=None, length=128, randomness=16): |
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.
On a bit more configuration, this breaks passing in None
for length
and randomness
(as this falls through (eventually) to Py::Float(sketch_params[0]);
with no extra validation. This should stay consistent with the convention of 'passing None
means do the default'.
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.
fixed
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.
and by 'configuration' I meant 'consideration'....
This allows independent backends to just implement the corresponding methods, rather than also having to provide the private attributes.
5859153
to
34aa69a
Compare
self.patch.set_clip_box(gc._cliprect) | ||
self.patch.set_clip_path(gc._clippath) | ||
self.patch.set_clip_box(gc.get_clip_rectangle()) | ||
clip_path = gc.get_clip_path() |
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.
This seems to be more correct and possibly fixes bugs? Is it worth tracking down what those might be?
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.
It's whatever bugs writing mpl_cairo has unearthed. I have a ton of them :-)
This allows independent backends to just implement the corresponding
methods, rather than also having to provide the private attributes.
Also simplify the signature/implementation of set_sketch_params.
PR Summary
PR Checklist