Skip to content

Commit

Permalink
Merge pull request #11 from LaboratoryOpticsBiosciences/update
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementCaporal authored Dec 24, 2024
2 parents 345eb17 + d7ff4ef commit a642640
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/napari_swc_editor/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,20 @@ def bind_layers_with_events(point_layer, shape_layer):
point_layer.bind_key("l")(event_add_edge)
point_layer.bind_key("Shift-l")(event_add_edge_wo_sort)
point_layer.bind_key("u")(event_remove_edge)
point_layer.bind_key("Ctrl", linked_point)

point_layer.metadata["shape_layer"] = shape_layer


def linked_point(layer):
"""Activate the Ctrl key for the next event.
Used to link points together"""

layer.metadata["Ctrl_activated"] = True
yield
layer.metadata["Ctrl_activated"] = False


def event_add_points(event):

if event.action == "added":
Expand Down

0 comments on commit a642640

Please sign in to comment.