From 0b82c4556a22bf37824921013f71f43b1f687cb3 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Mon, 31 Oct 2022 13:21:55 +0000 Subject: [PATCH] Use super() image layer artist _update_visual_attributes to ensure compatibility with recent versions of glue-code --- glue_jupyter/bqplot/image/layer_artist.py | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/glue_jupyter/bqplot/image/layer_artist.py b/glue_jupyter/bqplot/image/layer_artist.py index 998dad3d..6baf8062 100644 --- a/glue_jupyter/bqplot/image/layer_artist.py +++ b/glue_jupyter/bqplot/image/layer_artist.py @@ -64,27 +64,8 @@ def get_image_data(self, *args, **kwargs): return super().get_image_data(*args, **kwargs) def _update_visual_attributes(self): - # TODO: this is a copy of the super method, adding in the bitmap_visible state - if not self.enabled: - return - - if self._viewer_state.color_mode == 'Colormaps': - color = self.state.cmap - else: - color = self.state.color - - self.composite.set(self.uuid, - clim=(self.state.v_min, self.state.v_max), - visible=self.state.visible and self.state.bitmap_visible, - zorder=self.state.zorder, - color=color, - contrast=self.state.contrast, - bias=self.state.bias, - alpha=self.state.alpha, - stretch=self.state.stretch) - - self.composite_image.invalidate_cache() + super()._update_visual_attributes() was_visble = self.contour_artist.visible self.contour_artist.visible = self.state.visible and self.state.contour_visible @@ -92,6 +73,7 @@ def _update_visual_attributes(self): # switching from invisible to visible may leave the contour lines in an inconsistemt # state, since we don't update them when invisible, so we have to update them self._update_contour_lines() + self.redraw() def _update_contour_lines(self):