Skip to content

Commit

Permalink
Update selector to new API and verts.setter
Browse files Browse the repository at this point in the history
  • Loading branch information
dhomeier committed Dec 23, 2021
1 parent bb0849a commit e74ec80
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions regions/shapes/polygon.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,17 +266,12 @@ def sync_callback(*args, **kwargs):
pass

self._mpl_selector = PolygonSelector(
ax, sync_callback, draw_box=True,
ax, sync_callback, draw_bounding_box=True,
props={'color': self.visual.get('color', 'black'),
'linewidth': self.visual.get('linewidth', 1),
'linestyle': self.visual.get('linestyle', 'solid')})

self._mpl_selector._xs = list(self.vertices.x) + [self.vertices.x[0]]
self._mpl_selector._ys = list(self.vertices.y) + [self.vertices.y[0]]
self._mpl_selector._selection_completed = True
self._mpl_selector._draw_polygon()
self._mpl_selector._update_box()

self._mpl_selector.verts = list(zip(self.vertices.x, self.vertices.y))
self._mpl_selector.set_active(active)
self._mpl_selector_callback = callback

Expand Down

0 comments on commit e74ec80

Please sign in to comment.