mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
SvgLoader: Fix opacity propagation
Remove duplicate opacity calculation of the scene. Change-Id: I1253ea290e78fdbf946a492ebfcaaa082fbfc121
This commit is contained in:
parent
4d72eeda15
commit
62aa24d9ad
1 changed files with 4 additions and 2 deletions
|
@ -335,9 +335,11 @@ unique_ptr<Scene> _sceneBuildHelper(SvgNode* node, float vx, float vy, float vw,
|
|||
node->style->opacity = (node->style->opacity * parentOpacity) / 255.0f;
|
||||
if (node->display) {
|
||||
for (auto child : node->child) {
|
||||
child->style->opacity = (child->style->opacity * node->style->opacity) / 255.0f;
|
||||
if (child->type == SvgNodeType::Doc || child->type == SvgNodeType::G) scene->push(_sceneBuildHelper(child, vx, vy, vw, vh, node->style->opacity));
|
||||
else scene->push(_shapeBuildHelper(child, vx, vy, vw, vh));
|
||||
else {
|
||||
child->style->opacity = (child->style->opacity * node->style->opacity) / 255.0f;
|
||||
scene->push(_shapeBuildHelper(child, vx, vy, vw, vh));
|
||||
}
|
||||
}
|
||||
}
|
||||
return move(scene);
|
||||
|
|
Loading…
Add table
Reference in a new issue