From e74ec809498b92e1fcbb2f5da9d17c259ada1844 Mon Sep 17 00:00:00 2001 From: Derek Homeier Date: Thu, 23 Dec 2021 16:02:42 +0100 Subject: [PATCH] Update selector to new API and `verts.setter` --- regions/shapes/polygon.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/regions/shapes/polygon.py b/regions/shapes/polygon.py index 3d1a0534..4e826c68 100644 --- a/regions/shapes/polygon.py +++ b/regions/shapes/polygon.py @@ -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