Skip to content

Commit

Permalink
ignore non-legend pick events
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhi committed Jul 13, 2021
1 parent 763c90a commit 5862d8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion mpl_point_clicker/_clicker.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ def get_positions(self, copy=True):
def _on_pick(self, event):
# On the pick event, find the original line corresponding to the legend
# proxy line, and toggle its visibility.
klass = self._leg_artists[event.artist]
try:
klass = self._leg_artists[event.artist]
except KeyError:
# some pick event not on our legend
return
self._current_class = klass
self._update_legend_alpha()

Expand Down
2 changes: 1 addition & 1 deletion mpl_point_clicker/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# Copyright (c) Ian Hunt-Isaak.
# Distributed under the terms of the Modified BSD License.

version_info = (0, 1, 3)
version_info = (0, 1, 4)
__version__ = ".".join(map(str, version_info))

0 comments on commit 5862d8d

Please sign in to comment.