aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/InkingStroke.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-06-09 11:48:22 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-06-09 11:48:22 -0400
commit34d43b0d7ff1829514566e2b6b8514f6176e7c60 (patch)
treee20a2358d7feb64d9c11d76a91cedea31a6e6834 /src/client/views/InkingStroke.tsx
parentc878c35dc06c6f0c653390d95d18feeaf2dfabd1 (diff)
fixed keyFrame animation positioning issues when adding a doc at t != 0. added isInkMask field and inkStroke menu option to create an ink mask. added cantLeaveCollection flag.
Diffstat (limited to 'src/client/views/InkingStroke.tsx')
-rw-r--r--src/client/views/InkingStroke.tsx21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx
index b545ede54..7dac2e3b5 100644
--- a/src/client/views/InkingStroke.tsx
+++ b/src/client/views/InkingStroke.tsx
@@ -31,6 +31,14 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps, InkDocume
CognitiveServices.Inking.Appliers.ConcatenateHandwriting(this.dataDoc, ["inkAnalysis", "handwriting"], [data]);
}
+ private makeMask = () => {
+ this.props.Document._backgroundColor = "rgba(0,0,0,0.7)";
+ this.props.Document.mixBlendMode = "hard-light";
+ this.props.Document.color = "#9b9b9bff";
+ this.props.Document.cantLeaveCollection = true;
+ this.props.Document.isInkMask = true;
+ }
+
render() {
TraceMobx();
const data: InkData = Cast(this.dataDoc[this.fieldKey], InkField)?.inkData ?? [];
@@ -52,13 +60,14 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps, InkDocume
<svg className="inkingStroke"
width={width}
height={height}
- style={{ mixBlendMode: this.layoutDoc.tool === InkTool.Highlighter ? "multiply" : "unset" }}
+ style={{
+ pointerEvents: this.props.Document.isInkMask ? "all" : undefined,
+ transform: this.props.Document.isInkMask ? "translate(2500px, 2500px)" : undefined,
+ mixBlendMode: this.layoutDoc.tool === InkTool.Highlighter ? "multiply" : "unset"
+ }}
onContextMenu={() => {
- ContextMenu.Instance.addItem({
- description: "Analyze Stroke",
- event: this.analyzeStrokes,
- icon: "paint-brush"
- });
+ ContextMenu.Instance.addItem({ description: "Analyze Stroke", event: this.analyzeStrokes, icon: "paint-brush" });
+ ContextMenu.Instance.addItem({ description: "Make Mask", event: this.makeMask, icon: "paint-brush" });
}}
>
{points}