svg_loader: overwrite the clip's opacity/alpha 95/289895/1
authorMira Grudzinska <veleveta@gmail.com>
Tue, 17 Jan 2023 12:11:43 +0000 (13:11 +0100)
committerMichal Szczecinski <m.szczecinsk@partner.samsung.com>
Wed, 15 Mar 2023 07:18:08 +0000 (08:18 +0100)
According to the svg standard the clips opacity
doesn't affect the final rendering. In order to
avoid any confusion the opacity values are
overwritten by the max possible value.

Change-Id: I96699a2f74e97fae0a940e18d834f258a8c4cd86

src/loaders/svg/tvgSvgSceneBuilder.cpp

index 5e97b7410c9bd344a9dc2dfc7c7f3b883b9b5a94..f60c0f64bb3b48275eb68d6f340dcee9c768cc08 100644 (file)
@@ -264,8 +264,11 @@ static void _applyComposition(Paint* paint, const SvgNode* node, const Box& vBox
                 if (_appendChildShape(*child, comp.get(), vBox, svgPath)) valid = true;
             }
 
-            if (valid) paint->composite(move(comp), CompositeMethod::ClipPath);
-
+            if (valid) {
+                comp->fill(255, 255, 255, 255);
+                comp->opacity(255);
+                paint->composite(move(comp), CompositeMethod::ClipPath);
+            }
             node->style->clipPath.applying = false;
         }
     }