diff options
author | geireann <geireann.lindfield@gmail.com> | 2024-06-17 11:40:55 -0400 |
---|---|---|
committer | geireann <geireann.lindfield@gmail.com> | 2024-06-17 11:40:55 -0400 |
commit | cf539fc086c27f53cec764202d3212a996113638 (patch) | |
tree | fcdc6a9d8d06ebf67468f63e76a2daa699fd2c9e /src | |
parent | 56de54fea88891b621d6298541bd0a26334b8db5 (diff) |
updated multitoggle eraser to always toggle
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/global/globalScripts.ts | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/client/views/global/globalScripts.ts b/src/client/views/global/globalScripts.ts index 7730ed385..a985986d6 100644 --- a/src/client/views/global/globalScripts.ts +++ b/src/client/views/global/globalScripts.ts @@ -450,15 +450,19 @@ function setActiveTool(tool: InkTool | Gestures, keepPrim: boolean, checkResult? GestureOverlay.Instance.InkShape = tool as Gestures; } } else if (tool) { - if ([InkTool.StrokeEraser, InkTool.RadiusEraser, InkTool.SegmentEraser].includes(tool as any)) { - Doc.UserDoc().activeEraserTool = tool; - } - // pen or eraser - if (Doc.ActiveTool === tool && !GestureOverlay.Instance.InkShape && !keepPrim) { + if (Doc.UserDoc().ActiveTool === tool) { Doc.ActiveTool = InkTool.None; } else { - Doc.ActiveTool = tool as any; - GestureOverlay.Instance.InkShape = undefined; + if ([InkTool.StrokeEraser, InkTool.RadiusEraser, InkTool.SegmentEraser].includes(tool as any)) { + Doc.UserDoc().activeEraserTool = tool; + } + // pen or eraser + if (Doc.ActiveTool === tool && !GestureOverlay.Instance.InkShape && !keepPrim) { + Doc.ActiveTool = InkTool.None; + } else { + Doc.ActiveTool = tool as any; + GestureOverlay.Instance.InkShape = undefined; + } } } else { Doc.ActiveTool = InkTool.None; |