Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Line2D._path obeys drawstyle.#6497
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -17,7 +17,7 @@ | ||
from . import artist, colors as mcolors | ||
from .artist import Artist | ||
from .cbook import (iterable, is_string_like, is_numlike, ls_mapper_r, | ||
STEP_LOOKUP_MAP) | ||
from .path import Path | ||
from .transforms import Bbox, TransformedPath, IdentityTransform | ||
@@ -237,6 +237,7 @@ class Line2D(Artist): | ||
'steps': '_draw_steps_pre', | ||
} | ||
# drawStyles should now be deprecated. | ||
drawStyles = {} | ||
drawStyles.update(_drawStyles_l) | ||
drawStyles.update(_drawStyles_s) | ||
@@ -470,8 +471,7 @@ def contains(self, mouseevent): | ||
# application has set the error flags such that an exception is raised | ||
# on overflow, we temporarily set the appropriate error flags here and | ||
# set them back when we are finished. | ||
with np.errstate(all='ignore'): | ||
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. This is a pre-1.6 addition to numpy correct? (we are testing 1.6 with py2.7 on travis so this should be fine, but just being mildly paranoid) ContributorAuthor 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. Yes.
| ||
# Check for collision | ||
if self._linestyle in ['None', None]: | ||
# If no line, return the nearby point(s) | ||
@@ -480,20 +480,9 @@ def contains(self, mouseevent): | ||
else: | ||
# If line, return the nearby segment(s) | ||
ind = segment_hits(mouseevent.x, mouseevent.y, xt, yt, pixels) | ||
ind += self.ind_offset | ||
# Return the point(s) within radius | ||
return len(ind) > 0, dict(ind=ind) | ||
@@ -691,7 +680,8 @@ def recache(self, always=False): | ||
interpolation_steps = self._path._interpolation_steps | ||
else: | ||
interpolation_steps = 1 | ||
xy = STEP_LOOKUP_MAP[self._drawstyle](*self._xy.T) | ||
self._path = Path(np.asarray(xy).T, None, interpolation_steps) | ||
self._transformed_path = None | ||
self._invalidx = False | ||
self._invalidy = False | ||
@@ -764,8 +754,6 @@ def draw(self, renderer): | ||
tpath, affine = transf_path.get_transformed_path_and_affine() | ||
if len(tpath.vertices): | ||
self._lineFunc = getattr(self, funcname) | ||
gc = renderer.new_gc() | ||
self._set_gc_clip(gc) | ||
@@ -788,7 +776,7 @@ def draw(self, renderer): | ||
if self.get_sketch_params() is not None: | ||
gc.set_sketch_params(*self.get_sketch_params()) | ||
self._draw_lines(renderer, gc, tpath, affine.frozen()) | ||
gc.restore() | ||
if self._marker and self._markersize > 0: | ||
@@ -1234,27 +1222,6 @@ def set_dashes(self, seq): | ||
def _draw_lines(self, renderer, gc, path, trans): | ||
self._lineFunc(renderer, gc, path, trans) | ||
def _draw_solid(self, renderer, gc, path, trans): | ||
gc.set_linestyle('solid') | ||
renderer.draw_path(gc, path, trans) | ||