From 852eefc2d7ac19bd41fe1ca93dbcd67d66e4b31d Mon Sep 17 00:00:00 2001 From: adroitwhiz Date: Tue, 28 Jul 2020 08:27:38 -0400 Subject: [PATCH] Fix gradient outlines with 0 width in select mode Previously, if you selected a shape with a gradient outline that had a width of 0, its outline color wouldn't be null when it should have been. --- src/helper/style-path.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/helper/style-path.js b/src/helper/style-path.js index 17e0ae77..7b258e80 100644 --- a/src/helper/style-path.js +++ b/src/helper/style-path.js @@ -421,12 +421,18 @@ const getColorsFromSelection = function (selectedItems, bitmapMode) { } } if (item.strokeColor) { - if (item.strokeColor.type === 'gradient') { const {primary, secondary, gradientType} = _colorStateFromGradient(item.strokeColor.gradient); - const strokeColorString = primary; + + let strokeColorString = primary; const strokeColor2String = secondary; - const strokeGradientType = gradientType; + let strokeGradientType = gradientType; + + // If the item's stroke width is 0, pretend the stroke color is null + if (!item.strokeWidth) { + strokeColorString = null; + strokeGradientType = GradientTypes.SOLID; + } // Stroke color is fill color in bitmap if (bitmapMode) {