Skip to content

Commit

Permalink
Add double tap to deselect
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Aug 28, 2023
1 parent e3932ab commit 7c192c5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions holonote/annotate/annotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,19 @@ def tap_selector(x,y): # Tap tool must be enabled on the element
tap_stream.add_subscriber(tap_selector)
return element

def register_double_tap_clear(self, element):
def double_tap_clear(x, y):
self.clear_indicated_region()

double_tap_stream = hv.streams.DoubleTap(source=element, transient=True)
double_tap_stream.add_subscriber(double_tap_clear)
return element

def indicators(self):

if self.element is not None:
self.register_tap_selector(self.element)
self.register_double_tap_clear(self.element)

def inner(_count):
return self.static_indicators
Expand Down

0 comments on commit 7c192c5

Please sign in to comment.