svg_loader SceneBuilder: Use opacity() without using alpha color

If opacity value is set in node,
opacity() API is used without composing alpha color.
This commit is contained in:
JunsuChoi 2020-12-03 14:21:28 +09:00 committed by Hermet Park
parent d3020b7bbe
commit 3881f20e9c

View file

@ -232,11 +232,7 @@ void _applyProperty(SvgNode* node, Shape* vg, float vx, float vy, float vw, floa
}
//Apply node opacity
if (style->opacity < 255) {
uint8_t r, g, b, a;
vg->fillColor(&r, &g, &b, &a);
vg->fill(r, g, b, (a * style->opacity) / 255.0f);
}
if (style->opacity < 255) vg->opacity(style->opacity);
if (node->type == SvgNodeType::G) return;
@ -263,13 +259,6 @@ void _applyProperty(SvgNode* node, Shape* vg, float vx, float vy, float vw, floa
vg->stroke(style->stroke.paint.r, style->stroke.paint.g, style->stroke.paint.b, style->stroke.opacity);
}
//Apply node opacity to stroke color
if (style->opacity < 255) {
uint8_t r, g, b, a;
vg->strokeColor(&r, &g, &b, &a);
vg->stroke(r, g, b, (a * style->opacity) / 255.0f);
}
//Apply composite node
if (style->comp.node) {
//Composite ClipPath