svg_loader: overwrite the clip's opacity/alpha

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.
This commit is contained in:
Mira Grudzinska 2023-01-17 13:11:43 +01:00 committed by Mira Grudzinska
parent 2a3165d66b
commit b58c20b881

View file

@ -255,7 +255,6 @@ static void _applyComposition(Paint* paint, const SvgNode* node, const Box& vBox
node->style->clipPath.applying = true;
auto comp = Shape::gen();
comp->fill(255, 255, 255, 255);
if (node->transform) comp->transform(*node->transform);
auto child = compNode->child.data;
@ -265,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;
}
}