loaders svg: fix invalid clip path result.

tvg engine expects the valid clippath with valid colors,
loaders set any colors values to enable it.

this fixes invalid clippath behavior.
This commit is contained in:
Hermet Park 2021-04-08 17:39:51 +09:00 committed by JunsuChoi
parent 818d24fc70
commit 6239eca92f

View file

@ -271,6 +271,7 @@ void _applyProperty(SvgNode* node, Shape* vg, float vx, float vy, float vw, floa
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);
comp->fill(0, 0, 0, 255);
vg->composite(move(comp), CompositeMethod::ClipPath);
}
}
@ -375,6 +376,7 @@ unique_ptr<Scene> _sceneBuildHelper(const SvgNode* node, float vx, float vy, flo
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);
comp->fill(0, 0, 0, 255);
scene->composite(move(comp), CompositeMethod::ClipPath);
}
}