diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-10-15 18:20:34 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-10-15 18:20:34 -0400 |
commit | c3b20a75d4f9154c0260ebc25310cc5cd3c89f66 (patch) | |
tree | ceeb6f743b1ef41ba2c7061462fe5cfdb861a849 /src | |
parent | 33811c112c7e479813908ba10f72813954a3e289 (diff) |
fixed updating ink icon colors
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/InkingControl.tsx | 4 |
1 files changed, 4 insertions, 0 deletions
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 |