From d96b8f43859e0cd16a7e560874130135c4b40a71 Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Tue, 21 Mar 2023 23:27:00 +0100 Subject: [PATCH] svg_loader: invalid strokes' width set to zero In case the "stroke" attrib is set to "none", the width of the stroke is set to zero. Thanks to that it isn't taken into account while establishing the bounds of the shape. --- src/loaders/svg/tvgSvgSceneBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/loaders/svg/tvgSvgSceneBuilder.cpp b/src/loaders/svg/tvgSvgSceneBuilder.cpp index f00b3733..50097e42 100644 --- a/src/loaders/svg/tvgSvgSceneBuilder.cpp +++ b/src/loaders/svg/tvgSvgSceneBuilder.cpp @@ -346,7 +346,7 @@ static void _applyProperty(SvgNode* node, Shape* vg, const Box& vBox, const stri //If stroke property is nullptr then do nothing if (style->stroke.paint.none) { - //Do nothing + vg->stroke(0.0f); } else if (style->stroke.paint.gradient) { Box bBox = vBox; if (!style->stroke.paint.gradient->userSpace) bBox = _boundingBox(vg);