From e8760b8e8836f8467fb7b98f5462a32eecd748cd Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 14 Jun 2023 13:43:50 -0400 Subject: fixing ink masks when selected to not turn blue/black --- src/client/views/InkingStroke.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx index c915ae65a..28d039278 100644 --- a/src/client/views/InkingStroke.tsx +++ b/src/client/views/InkingStroke.tsx @@ -403,9 +403,12 @@ export class InkingStroke extends ViewBoxBaseComponent() { ); const highlight = !this.controlUndo && this.props.styleProvider?.(this.rootDoc, this.props, StyleProp.Highlighting); const highlightIndex = highlight?.highlightIndex; - const highlightColor = highlight?.highlightIndex ? highlight?.highlightColor : StrCast(this.layoutDoc.stroke_outlineColor, !closed && fillColor && fillColor !== 'transparent' ? StrCast(this.layoutDoc.color, 'transparent') : 'transparent'); + const highlightColor = + (!this.props.isSelected() || !isInkMask) && highlight?.highlightIndex + ? highlight?.highlightColor + : StrCast(this.layoutDoc.stroke_outlineColor, !closed && fillColor && fillColor !== 'transparent' ? StrCast(this.layoutDoc.color, 'transparent') : 'transparent'); // Invisible polygonal line that enables the ink to be selected by the user. - const clickableLine = (downHdlr?: (e: React.PointerEvent) => void, suppressFill: boolean = false, mask: boolean = false) => + const clickableLine = (downHdlr?: (e: React.PointerEvent) => void, mask: boolean = false) => InteractionUtils.CreatePolyline( inkData, inkLeft, @@ -416,7 +419,7 @@ export class InkingStroke extends ViewBoxBaseComponent() { StrCast(this.layoutDoc.stroke_lineJoin), StrCast(this.layoutDoc.stroke_lineCap), StrCast(this.layoutDoc.stroke_bezier), - !closed ? 'none' : !isInkMask && (fillColor === 'transparent' || suppressFill) ? 'none' : fillColor, + !closed || fillColor === 'transparent' ? 'none' : fillColor, '', '', markerScale, @@ -456,8 +459,8 @@ export class InkingStroke extends ViewBoxBaseComponent() { cursor: this.props.isSelected() ? 'default' : undefined, }} {...interactions}> - {clickableLine(this.onPointerDown, undefined, isInkMask)} - {isInkMask ? null : inkLine} + {clickableLine(this.onPointerDown, isInkMask)} + {isInkMask && (!closed || (fillColor && DashColor(fillColor).alpha() !== 0)) ? null : inkLine} {!closed || (!RTFCast(this.rootDoc.text)?.Text && (!this.props.isSelected() || Doc.UserDoc().activeInkHideTextLabels)) ? null : (