From c3b20a75d4f9154c0260ebc25310cc5cd3c89f66 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Tue, 15 Oct 2019 18:20:34 -0400 Subject: fixed updating ink icon colors --- src/client/views/InkingControl.tsx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/client/views/InkingControl.tsx b/src/client/views/InkingControl.tsx index 149a4fc8a..b51264932 100644 --- a/src/client/views/InkingControl.tsx +++ b/src/client/views/InkingControl.tsx @@ -9,6 +9,7 @@ import { Utils } from "../../Utils"; import { Scripting } from "../util/Scripting"; import { SelectionManager } from "../util/SelectionManager"; import { undoBatch, UndoManager } from "../util/UndoManager"; +import { CurrentUserUtils } from "../../server/authentication/models/current_user_utils"; export class InkingControl { @@ -36,6 +37,7 @@ export class InkingControl { @undoBatch switchColor = action((color: ColorResult): void => { this._selectedColor = color.hex + (color.rgb.a !== undefined ? this.decimalToHexString(Math.round(color.rgb.a * 255)) : "ff"); + if (InkingControl.Instance.selectedTool === InkTool.None) { let selected = SelectionManager.SelectedDocuments(); let oldColors = selected.map(view => { @@ -89,6 +91,8 @@ export class InkingControl { undo: () => oldColors.forEach(pair => pair.target.backgroundColor = pair.previous), redo: () => oldColors.forEach(pair => pair.target.backgroundColor = captured) }); + } else { + CurrentUserUtils.UserDocument.activePen instanceof Doc && CurrentUserUtils.UserDocument.activePen.pen instanceof Doc && (CurrentUserUtils.UserDocument.activePen.pen.backgroundColor = this._selectedColor); } }); @action -- cgit v1.2.3-70-g09d2