Prefer to the GraphicsContext public API when possible.#8848
Prefer to the GraphicsContext public API when possible.#8848dopplershift merged 1 commit intomatplotlib:masterfrom
Conversation
|
The appveyor failures are un-related (see #8849 ) |
lib/matplotlib/backend_bases.py
Outdated
| 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.
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.
tacaswell
left a comment
There was a problem hiding this comment.
The simplification to set_sktech_params should be reverted please.
lib/matplotlib/backend_bases.py
Outdated
| 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.
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.
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.
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.
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