aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-10-15 18:36:05 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-10-15 18:36:05 -0400
commit8313f6d5403ac91b973baca8d80e1d1e3b6cc8d6 (patch)
tree2fad6403dae679fc573c8fb14c4e91c3ccb11655
parent4e65c84c768da1eabeca552df54ea1ed78812f8e (diff)
parentc3b20a75d4f9154c0260ebc25310cc5cd3c89f66 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
-rw-r--r--src/client/views/InkingControl.tsx4
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