From cd79f336ced93dee47ef6b00dd276bc409ad9165 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Thu, 10 Sep 2020 20:13:31 +0900 Subject: [PATCH] SvgLoader: Fix missing doc.gradients update When both and gradients are declared, the update of gradient declared in is omitted. Therefore, this patch fixes any missing gradient updates. Change-Id: I21f5c31dbc679f8308e19c17bf942b23c4b2bebe --- src/loaders/svg/tvgSvgLoader.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/loaders/svg/tvgSvgLoader.cpp b/src/loaders/svg/tvgSvgLoader.cpp index 4ade095..86537cd 100644 --- a/src/loaders/svg/tvgSvgLoader.cpp +++ b/src/loaders/svg/tvgSvgLoader.cpp @@ -2355,11 +2355,8 @@ void SvgLoader::run() _updateStyle(loaderData.doc, nullptr); auto defs = loaderData.doc->node.doc.defs; if (defs) _updateGradient(loaderData.doc, &defs->node.defs.gradients); - else { - if (loaderData.gradients.cnt > 0) { - _updateGradient(loaderData.doc, &loaderData.gradients); - } - } + + if (loaderData.gradients.cnt > 0) _updateGradient(loaderData.doc, &loaderData.gradients); } root = builder.build(loaderData.doc); }; -- 2.7.4