-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
More code removal #7771
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
More code removal #7771
Changes from all commits
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Deprecation of `GraphicsContextBase`\'s ``linestyle`` property. | ||
``````````````````````````````````````````````````````````````` | ||
|
||
The ``GraphicsContextBase.get_linestyle`` and | ||
``GraphicsContextBase.set_linestyle`` methods, which effectively had no effect, | ||
have been deprecated. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -771,11 +771,9 @@ def draw(self, renderer): | |
renderer = PathEffectRenderer(self.get_path_effects(), renderer) | ||
|
||
renderer.open_group('line2d', self.get_gid()) | ||
funcname = self._lineStyles.get(self._linestyle, '_draw_nothing') | ||
if funcname != '_draw_nothing': | ||
if self._lineStyles[self._linestyle] != '_draw_nothing': | ||
tpath, affine = transf_path.get_transformed_path_and_affine() | ||
if len(tpath.vertices): | ||
line_func = getattr(self, funcname) | ||
gc = renderer.new_gc() | ||
self._set_gc_clip(gc) | ||
|
||
|
@@ -798,7 +796,8 @@ def draw(self, renderer): | |
if self.get_sketch_params() is not None: | ||
gc.set_sketch_params(*self.get_sketch_params()) | ||
|
||
line_func(renderer, gc, tpath, affine.frozen()) | ||
gc.set_dashes(self._dashOffset, self._dashSeq) | ||
renderer.draw_path(gc, tpath, affine.frozen()) | ||
gc.restore() | ||
|
||
if self._marker and self._markersize > 0: | ||
|
@@ -1244,26 +1243,6 @@ def set_dashes(self, seq): | |
else: | ||
self.set_linestyle((0, seq)) | ||
|
||
def _draw_solid(self, renderer, gc, path, trans): | ||
gc.set_linestyle('solid') | ||
gc.set_dashes(self._dashOffset, self._dashSeq) | ||
renderer.draw_path(gc, path, trans) | ||
|
||
def _draw_dashed(self, renderer, gc, path, trans): | ||
gc.set_linestyle('dashed') | ||
gc.set_dashes(self._dashOffset, self._dashSeq) | ||
renderer.draw_path(gc, path, trans) | ||
|
||
def _draw_dash_dot(self, renderer, gc, path, trans): | ||
gc.set_linestyle('dashdot') | ||
gc.set_dashes(self._dashOffset, self._dashSeq) | ||
renderer.draw_path(gc, path, trans) | ||
|
||
def _draw_dotted(self, renderer, gc, path, trans): | ||
gc.set_linestyle('dotted') | ||
gc.set_dashes(self._dashOffset, self._dashSeq) | ||
renderer.draw_path(gc, path, trans) | ||
|
||
def update_from(self, other): | ||
"""copy properties from other to self""" | ||
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. I do not think we want to remove setting these with out a deprecation cycle. 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. butbutbut they're private :/ 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. I do not mind removing the methods, it the inner call to 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. (I meant to click on the line below and apparently missed). 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. The whole point is that graphics contexts don't have that property anymore. |
||
Artist.update_from(self, other) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,12 +156,12 @@ def draw(self, renderer): | |
join = self._solidjoinstyle | ||
gc.set_joinstyle(join) | ||
gc.set_capstyle(cap) | ||
gc.set_dashes(self._dashOffset, self._dashSeq) | ||
|
||
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 will now raise on non-valid 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.
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. 👍 |
||
funcname = self._lineStyles.get(self._linestyle, '_draw_nothing') | ||
if funcname != '_draw_nothing': | ||
tpath, affine = self._transformed_path.get_transformed_path_and_affine() | ||
lineFunc = getattr(self, funcname) | ||
lineFunc(renderer, gc, tpath, affine.frozen()) | ||
if self._lineStyles[self._linestyle] != '_draw_nothing': | ||
tpath, affine = ( | ||
self._transformed_path.get_transformed_path_and_affine()) | ||
renderer.draw_path(gc, tpath, affine.frozen()) | ||
|
||
gc.restore() | ||
renderer.close_group('line2d') | ||
|
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.
Should we deprecate
dashd_wx
as well?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.
There's a bunch of other entries in wx_compat.py which are not used (e.g. StockCursor) so I think that would belong to a (separate) cleanup of wx_compat.