From 4d3960bfff57d6e0840f4d09d5a5150a055ac788 Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 10 Sep 2021 10:21:46 -0400 Subject: turned pen on/off and ink handles on/off whenever the other is activated. --- src/client/views/InkStrokeProperties.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/client/views/InkStrokeProperties.ts') diff --git a/src/client/views/InkStrokeProperties.ts b/src/client/views/InkStrokeProperties.ts index d527b2a05..42190238e 100644 --- a/src/client/views/InkStrokeProperties.ts +++ b/src/client/views/InkStrokeProperties.ts @@ -1,13 +1,14 @@ -import { action, computed, observable } from "mobx"; +import { action, computed, observable, reaction } from "mobx"; import { Doc, DocListCast, Field, Opt } from "../../fields/Doc"; import { Document } from "../../fields/documentSchemas"; -import { InkField, InkData, PointData, ControlPoint } from "../../fields/InkField"; +import { InkField, InkData, PointData, ControlPoint, InkTool } from "../../fields/InkField"; import { List } from "../../fields/List"; import { listSpec } from "../../fields/Schema"; import { Cast, NumCast } from "../../fields/Types"; import { DocumentType } from "../documents/DocumentTypes"; import { SelectionManager } from "../util/SelectionManager"; import { undoBatch } from "../util/UndoManager"; +import { CurrentUserUtils } from "../util/CurrentUserUtils"; export class InkStrokeProperties { static Instance: InkStrokeProperties | undefined; @@ -18,6 +19,8 @@ export class InkStrokeProperties { constructor() { InkStrokeProperties.Instance = this; + reaction(() => this._controlButton, button => button && (CurrentUserUtils.SelectedTool = InkTool.None)); + reaction(() => CurrentUserUtils.SelectedTool, tool => (tool !== InkTool.None) && (this._controlButton = false)); } @computed get selectedInk() { -- cgit v1.2.3-70-g09d2