From d84e5e92fe7a016ec42882fcf23fe523236d03b3 Mon Sep 17 00:00:00 2001 From: Igor Octaviano Date: Sat, 29 Aug 2026 10:37:20 -0300 Subject: [PATCH] fix: prevent FRACTIONAL colormap from being replaced on opacity change The handleOpacityChange function was always sending color along with opacity, which caused SlideViewer.handleSegmentStyleChange to create a new palette from that flat color, replacing the distinct colormap used by FRACTIONAL segments. Now handleOpacityChange only sends opacity. Color changes are handled separately by handleColorChange, which is already hidden in the UI for FRACTIONAL segments. Fixes #428 --- src/components/SegmentItem.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/SegmentItem.tsx b/src/components/SegmentItem.tsx index 81331f86..ee985408 100644 --- a/src/components/SegmentItem.tsx +++ b/src/components/SegmentItem.tsx @@ -99,11 +99,15 @@ class SegmentItem extends React.Component { return { currentStyle: newStyle } }, () => { + /** + * Only send opacity - do not include color. For FRACTIONAL segments, + * sending color would replace the distinct colormap with a flat LUT. + * Color changes are handled separately by handleColorChange. + */ this.props.onStyleChange({ segmentUID: this.props.segment.uid, styleOptions: { opacity, - color: this.state.currentStyle.color, }, }) },