File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 5
5
import numpy as np
6
6
from napari ._qt .layer_controls .qt_points_controls import QtPointsControls
7
7
from napari .layers import Points
8
+ from napari .layers .points ._points_constants import SYMBOL_TRANSLATION_INVERTED
9
+ from napari .layers .points ._points_utils import coerce_symbols
8
10
9
11
from napari_deeplabcut .misc import CycleEnum
10
12
@@ -19,7 +21,17 @@ def _change_size(self, value):
19
21
self .layer .events .size ()
20
22
21
23
24
+ def _change_symbol (self , text ):
25
+ symbol = coerce_symbols (np .array ([SYMBOL_TRANSLATION_INVERTED [text ]]))[0 ]
26
+ self .layer ._current_symbol = symbol
27
+ if self .layer ._update_properties :
28
+ self .layer .symbol = symbol
29
+ self .layer .events .symbol ()
30
+ self .layer .events .current_symbol ()
31
+
32
+
22
33
QtPointsControls .changeCurrentSize = _change_size
34
+ QtPointsControls .changeCurrentSymbol = _change_symbol
23
35
24
36
25
37
class LabelMode (CycleEnum ):
You can’t perform that action at this time.
0 commit comments