Skip to content

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

Merged
merged 1 commit into from
Jul 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,9 +1120,10 @@ def get_hatch_path(self, density=6.0):
"""
Returns a Path for the current hatch.
"""
if self._hatch is None:
hatch = self.get_hatch()
if hatch is None:
return None
return Path.hatch(self._hatch, density)
return Path.hatch(hatch, density)

def get_hatch_color(self):
"""
Expand Down Expand Up @@ -1178,16 +1179,15 @@ def set_sketch_params(self, scale=None, length=None, randomness=None):

length : float, optional
The length of the wiggle along the line, in pixels
(default 128.0)
(default 128)

randomness : float, optional
The scale factor by which the length is shrunken or
expanded (default 16.0)
expanded (default 16)
"""
if scale is None:
self._sketch = None
else:
self._sketch = (scale, length or 128.0, randomness or 16.0)
self._sketch = (
None if scale is None
else (scale, length or 128., randomness or 16.))


class TimerBase(object):
Expand Down
6 changes: 4 additions & 2 deletions lib/matplotlib/patheffects.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ def draw_path(self, renderer, gc, tpath, affine, rgbFace):
affine = self._offset_transform(renderer, affine)
self.patch._path = tpath
self.patch.set_transform(affine)
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()
Copy link
Member

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?

Copy link
Contributor Author

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 :-)

if clip_path:
self.patch.set_clip_path(*clip_path)
self.patch.draw(renderer)