mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 11:36:25 +00:00
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:
parent
d3020b7bbe
commit
3881f20e9c
1 changed files with 1 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue