aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/InkingStroke.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-03-16 20:59:48 -0400
committerbobzel <zzzman@gmail.com>2021-03-16 20:59:48 -0400
commit04225e5248ac46c4f9fdc698ec1526b53fd02164 (patch)
tree3927e041f99c6cb4ea90f16ba36c9a7a62b77fc8 /src/client/views/InkingStroke.tsx
parent516b29492a9e14c7d3ace1f0c5db56b0d69e421e (diff)
more chromeStatus cleanup. Big stripdown of propertiesButtons.
Diffstat (limited to 'src/client/views/InkingStroke.tsx')
-rw-r--r--src/client/views/InkingStroke.tsx15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx
index 31279338f..34cdb50e3 100644
--- a/src/client/views/InkingStroke.tsx
+++ b/src/client/views/InkingStroke.tsx
@@ -33,12 +33,13 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps, InkDocume
CognitiveServices.Inking.Appliers.ConcatenateHandwriting(this.dataDoc, ["inkAnalysis", "handwriting"], [data]);
}
- private makeMask = () => {
- this.props.Document.mixBlendMode = "hard-light";
- this.props.Document.color = "#9b9b9bff";
- //this.props.Document._stayInCollection = true;
- this.props.Document.isInkMask = true;
- }
+ public static toggleMask = action((inkDoc: Doc) => {
+ inkDoc.isInkMask = !inkDoc.isInkMask;
+ inkDoc._backgroundColor = inkDoc.isInkMask ? "rgba(0,0,0,0.7)" : undefined;
+ inkDoc.mixBlendMode = inkDoc.isInkMask ? "hard-light" : undefined;
+ inkDoc.color = "#9b9b9bff";
+ inkDoc._stayInCollection = inkDoc.isInkMask ? true : undefined;
+ })
public _prevX = 0;
public _prevY = 0;
@@ -205,7 +206,7 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps, InkDocume
const cm = ContextMenu.Instance;
if (cm) {
!Doc.UserDoc().noviceMode && cm.addItem({ description: "Recognize Writing", event: this.analyzeStrokes, icon: "paint-brush" });
- cm.addItem({ description: "Make Mask", event: this.makeMask, icon: "paint-brush" });
+ cm.addItem({ description: "Toggle Mask", event: () => InkingStroke.toggleMask(this.rootDoc), icon: "paint-brush" });
cm.addItem({ description: "Edit Points", event: action(() => formatInstance._controlBtn = !formatInstance._controlBtn), icon: "paint-brush" });
//cm.addItem({ description: "Format Shape...", event: this.formatShape, icon: "paint-brush" });
}