From c491af64d83c577421e8394ad916bff60e9e685d Mon Sep 17 00:00:00 2001
From: togir <39676950+togir2@users.noreply.github.com>
Date: Wed, 22 Jul 2020 21:53:51 +0200
Subject: [PATCH] Keep the colors between drawing multiple scribbles and arrows
 (#61)

* Keep the colors between drawing multiple scribbles and arrows

The color is changed back to black on every new drawing. Now the color is kept. If there is no color is set, then there is a fallback to the black stroke as before.

* requested changes

Co-authored-by: togir <gitcatch@weiler.rocks>
---
 public/javascripts/spacedeck_whiteboard.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/public/javascripts/spacedeck_whiteboard.js b/public/javascripts/spacedeck_whiteboard.js
index 8b8c1da..54be6aa 100644
--- a/public/javascripts/spacedeck_whiteboard.js
+++ b/public/javascripts/spacedeck_whiteboard.js
@@ -592,7 +592,8 @@ function setup_whiteboard_directives() {
         z: z,
         w: 64,
         h: 64,
-        stroke_color: "#000000",
+        // Set the color to the last selected color, fallback to black if no color was selected
+        stroke_color: "#" + $scope.color_picker_rgb || "#000000",
         stroke: 2,
         shape: "scribble"
       };
@@ -629,7 +630,8 @@ function setup_whiteboard_directives() {
         z: z,
         w: 64,
         h: 64,
-        stroke_color: "#000000",
+        // Set the color to the last selected color, fallback to black if no color was selected
+        stroke_color: "#" + $scope.color_picker_rgb || "#000000",
         stroke: 2,
         shape: "arrow"
       };
-- 
GitLab