svg_loader: applying AlphaMask during scene building

The AlphaMask composition case was omitted in the _sceneBuilderHelper().
This commit is contained in:
Mira Grudzinska 2021-03-11 17:20:41 +01:00 committed by JunsuChoi
parent e8cf21a3c9
commit f0540d753a

View file

@ -378,6 +378,16 @@ unique_ptr<Scene> _sceneBuildHelper(const SvgNode* node, float vx, float vy, flo
scene->composite(move(comp), CompositeMethod::ClipPath);
}
}
//Composite AlphaMask
if (((int)node->style->comp.flags & (int)SvgCompositeFlags::AlphaMask)) {
auto compNode = node->style->comp.node;
if (compNode->child.count > 0) {
auto comp = Shape::gen();
auto child = compNode->child.data;
for (uint32_t i = 0; i < compNode->child.count; ++i, ++child) _appendChildShape(*child, comp.get(), vx, vy, vw, vh);
scene->composite(move(comp), CompositeMethod::AlphaMask);
}
}
}
scene->opacity(node->style->opacity);
}