From e3f5b34e3784c9e5da2bfee16818e88aa6f3162c Mon Sep 17 00:00:00 2001 From: Stefan Beckmann Date: Sun, 15 Nov 2020 23:10:18 +0100 Subject: [PATCH] fixes #82: stroke color and width are now taken from current selection When using the scribble or arrow tool the stroke color and stroke width will be set to the stroke color or width of the currently selected item. If stroke width is 0 it will default to two. if stroke color is transparent it will default to black. --- public/javascripts/spacedeck_whiteboard.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/javascripts/spacedeck_whiteboard.js b/public/javascripts/spacedeck_whiteboard.js index 9e65a68..ebcd662 100644 --- a/public/javascripts/spacedeck_whiteboard.js +++ b/public/javascripts/spacedeck_whiteboard.js @@ -588,8 +588,8 @@ function setup_whiteboard_directives() { z: z, w: 64, h: 64, - stroke_color: $scope.active_style.stroke_color, - stroke: 2, + stroke_color: $scope.active_style.stroke_color == "rgba(0,0,0,0)" ? "rgba(0,0,0,255)" : $scope.active_style.stroke_color, + stroke: $scope.active_style.stroke == 0 ? 2 : $scope.active_style.stroke, shape: "scribble" }; @@ -624,8 +624,8 @@ function setup_whiteboard_directives() { z: z, w: 64, h: 64, - stroke_color: $scope.active_style.stroke_color, - stroke: 2, + stroke_color: $scope.active_style.stroke_color == "rgba(0,0,0,0)" ? "rgba(0,0,0,255)" : $scope.active_style.stroke_color, + stroke: $scope.active_style.stroke == 0 ? 2 : $scope.active_style.stroke, shape: "arrow" };