From ea4c0af6de5eaace24a7885872192e22c7f85d43 Mon Sep 17 00:00:00 2001 From: flatberg Date: Mon, 15 Jan 2007 15:46:24 +0000 Subject: [PATCH] fixed shift/control on lasso --- fluents/plots.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fluents/plots.py b/fluents/plots.py index bc53747..8dbd6c7 100644 --- a/fluents/plots.py +++ b/fluents/plots.py @@ -1175,7 +1175,6 @@ class SelectPlotMode2 (PlotMode): def __init__(self, plot): PlotMode.__init__(self, plot, 'lassoselect', 'Select within lasso', 'lasso') - self._selectors = {} def activate(self): self._button_press = self.canvas.mpl_connect( @@ -1188,11 +1187,16 @@ class SelectPlotMode2 (PlotMode): def _on_select(self, event): if self.canvas.widgetlock.locked(): return if event.inaxes is None: return - self.plot._lasso = Lasso(event.inaxes, (event.xdata, event.ydata), self.plot.lasso_select_callback) + self.plot._lasso = Lasso(event.inaxes, (event.xdata, event.ydata), self.lasso_callback) self.plot._lasso.line.set_linewidth(1) self.plot._lasso.line.set_linestyle('--') # get a lock on the widget self.canvas.widgetlock(self.plot._lasso) + self._event = event + + def lasso_callback(self, verts): + self.plot.lasso_select_callback(verts, self._event.key) + class SelectPlotMode (PlotMode): def __init__(self, plot):