mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
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:
parent
2a3165d66b
commit
b58c20b881
1 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue