diff --git a/CHANGELOG.md b/CHANGELOG.md index 386e28a2c65c6c3144219379c3d3bbafc420516d..a65776dc4982f82c5658fbf34b71ba61199b53d9 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,7 +62,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed blinking of the regulation plot legend - Fixed undisplayed ROIs during a scan. A tool is provided to display them if not already selected. - - Fix update of the property view after an update of the backend + - Fixed update of the property view after an update of the backend + - Fixed colormap LUT of the scatter plot when it is set with the style dialog ### Removed diff --git a/bliss/flint/helper/model_helper.py b/bliss/flint/helper/model_helper.py index f5830fa3f57357e0402c9fd284b32f35f6331560..74230efff1c38bdab4fa9fe22d2e59f051649af0 100755 --- a/bliss/flint/helper/model_helper.py +++ b/bliss/flint/helper/model_helper.py @@ -570,20 +570,6 @@ def getFastChannel( return None -def getColormapWithItemStyle( - item: plot_model.Item, - style: style_model.Style, - defaultColormap: Optional[colors.Colormap] = None, -) -> colors.Colormap: - """Returns the provided colormap updated with the item style preferences - """ - if defaultColormap is not None: - if style is not None: - defaultColormap.setName(style.colormapLut) - - return defaultColormap - - def getColormapFromItem( item: plot_model.Item, style: style_model.Style, diff --git a/bliss/flint/model/plot_item_model.py b/bliss/flint/model/plot_item_model.py index ae282b44152140ecc9be34410e6f764db52fa3d1..94ce764f5b53e79f9c41ca34977a61d81a3a0c9b 100755 --- a/bliss/flint/model/plot_item_model.py +++ b/bliss/flint/model/plot_item_model.py @@ -25,6 +25,7 @@ import numpy from . import scan_model from . import plot_model +from . import style_model class ScalarPlot(plot_model.Plot): @@ -403,6 +404,14 @@ class ImageItem(plot_model.Item): self.__image = channel self._emitValueChanged(plot_model.ChangeEventType.IMAGE_CHANNEL) + def setCustomStyle(self, style: style_model.Style): + result = super(ImageItem, self).setCustomStyle(style) + if self.__colormap is not None: + # Make sure the cache is updated + if style.colormapLut is not None: + self.__colormap.setName(style.colormapLut) + return result + def colormap(self): return self.__colormap @@ -574,6 +583,14 @@ class ScatterItem(plot_model.Item): array = channel.array(scan) return array + def setCustomStyle(self, style: style_model.Style): + result = super(ScatterItem, self).setCustomStyle(style) + if self.__colormap is not None: + # Make sure the cache is updated + if style.colormapLut is not None: + self.__colormap.setName(style.colormapLut) + return result + def colormap(self): return self.__colormap diff --git a/bliss/flint/widgets/scatter_plot.py b/bliss/flint/widgets/scatter_plot.py index 1c31aa68bf80426cfa537c8a06d9991c6e0ed4bd..bb62b52eb260dbf093d9c9162002ae43c34ecb0c 100755 --- a/bliss/flint/widgets/scatter_plot.py +++ b/bliss/flint/widgets/scatter_plot.py @@ -947,7 +947,7 @@ class ScatterPlotWidget(plot_helper.PlotWidget): legend = valueChannel.name() style = item.getStyle(scan) - colormap = model_helper.getColormapWithItemStyle(item, style, self.__colormap) + colormap = model_helper.getColormapFromItem(item, style, self.__colormap) scatter = None curve = None