diff options
author | bobzel <zzzman@gmail.com> | 2023-06-14 13:43:50 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-06-14 13:43:50 -0400 |
commit | e8760b8e8836f8467fb7b98f5462a32eecd748cd (patch) | |
tree | abf134a23609c279898f2575198f66a30aa5dcd9 /src | |
parent | 38edde57bc7bcf45ad314e66d98152282b9fd57c (diff) |
fixing ink masks when selected to not turn blue/black
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/InkingStroke.tsx | 13 |
1 files changed, 8 insertions, 5 deletions
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<FieldViewProps>() { ); 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<FieldViewProps>() { 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<FieldViewProps>() { 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} </svg> {!closed || (!RTFCast(this.rootDoc.text)?.Text && (!this.props.isSelected() || Doc.UserDoc().activeInkHideTextLabels)) ? null : ( <div |