Skip to content

Commit 22a9804

Browse files
committed
Always call on_update_layers
1 parent 91572ef commit 22a9804

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Diff for: src/napari_matplotlib/base.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,6 @@ def _valid_layer_selection(self) -> bool:
229229
"""
230230
Return `True` if layer selection is valid.
231231
"""
232-
print(f"{self.n_selected_layers=}")
233-
print(f"{self.n_layers_input=}")
234-
print(f"{self.layers=}")
235-
print(f"{self.input_layer_types=}")
236232
return self.n_selected_layers in self.n_layers_input and all(
237233
isinstance(layer, self.input_layer_types) for layer in self.layers
238234
)
@@ -243,8 +239,8 @@ def _update_layers(self, event: napari.utils.events.Event) -> None:
243239
"""
244240
self.layers = list(self.viewer.layers.selection)
245241
self.layers = sorted(self.layers, key=lambda layer: layer.name)
242+
self.on_update_layers()
246243
if self._valid_layer_selection:
247-
self.on_update_layers()
248244
self._draw()
249245

250246
def _draw(self) -> None:
@@ -280,7 +276,6 @@ def on_update_layers(self) -> None:
280276
Called when the selected layers are updated.
281277
282278
This is a no-op, and is intended for derived classes to override.
283-
It is only called if a selected layer is one of the input layer types.
284279
"""
285280

286281

0 commit comments

Comments
 (0)