diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/InkingStroke.tsx | 8 | ||||
-rw-r--r-- | src/client/views/StyleProvider.scss | 2 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 4 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx index 8df7f7eef..19b23af13 100644 --- a/src/client/views/InkingStroke.tsx +++ b/src/client/views/InkingStroke.tsx @@ -6,7 +6,7 @@ import { InkData, InkField, InkTool } from "../../fields/InkField"; import { makeInterface } from "../../fields/Schema"; import { Cast, StrCast } from "../../fields/Types"; import { TraceMobx } from "../../fields/util"; -import { setupMoveUpEvents } from "../../Utils"; +import { setupMoveUpEvents, emptyFunction, returnFalse } from "../../Utils"; import { CognitiveServices } from "../cognitive_services/CognitiveServices"; import { InteractionUtils } from "../util/InteractionUtils"; import { Scripting } from "../util/Scripting"; @@ -87,6 +87,11 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps, InkDocume } } + onPointerDown = (e: React.PointerEvent) => { + this.props.isSelected(true) && setupMoveUpEvents(this, e, returnFalse, emptyFunction, action((e: PointerEvent, doubleTap: boolean | undefined) => { + doubleTap && InkStrokeProperties.Instance && (InkStrokeProperties.Instance._controlBtn = true); + })); + } public static MaskDim = 50000; render() { @@ -196,6 +201,7 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps, InkDocume mixBlendMode: this.layoutDoc.tool === InkTool.Highlighter ? "multiply" : "unset", overflow: "visible", }} + onPointerDown={this.onPointerDown} onContextMenu={() => { const cm = ContextMenu.Instance; if (cm) { diff --git a/src/client/views/StyleProvider.scss b/src/client/views/StyleProvider.scss index df63288f1..94001730c 100644 --- a/src/client/views/StyleProvider.scss +++ b/src/client/views/StyleProvider.scss @@ -3,7 +3,7 @@ width: 20; height: 20; position: absolute; - right: -5; + right: -25; top: -5; background: transparent; pointer-events: all; diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 06bf04dd6..6217f473f 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -386,9 +386,7 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps }, console.log); undoBatch(func)(); } else if (!Doc.IsSystem(this.props.Document)) { - if (this.props.Document.type === DocumentType.INK) { - InkStrokeProperties.Instance && (InkStrokeProperties.Instance._controlBtn = true); - } else if (this.props.Document.type !== DocumentType.LABEL) { + if (this.props.Document.type !== DocumentType.LABEL) { UndoManager.RunInBatch(() => { const fullScreenDoc = Cast(this.props.Document._fullScreenView, Doc, null) || this.props.Document; this.props.addDocTab(fullScreenDoc, "add"); |