svg_loader: fix opacity cloning

The opacity value should be copied along
with other node properties.
This commit is contained in:
Mira Grudzinska 2024-04-24 14:04:36 +02:00 committed by Hermet Park
parent edc63ce28e
commit d55b8afd6a

View file

@ -1104,6 +1104,7 @@ static void _handleFillRuleAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node,
static void _handleOpacityAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) static void _handleOpacityAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value)
{ {
node->style->flags = (node->style->flags | SvgStyleFlags::Opacity);
node->style->opacity = _toOpacity(value); node->style->opacity = _toOpacity(value);
} }
@ -2962,6 +2963,9 @@ static void _styleCopy(SvgStyleProperty* to, const SvgStyleProperty* from)
to->color = from->color; to->color = from->color;
to->curColorSet = true; to->curColorSet = true;
} }
if (from->flags & SvgStyleFlags::Opacity) {
to->opacity = from->opacity;
}
if (from->flags & SvgStyleFlags::PaintOrder) { if (from->flags & SvgStyleFlags::PaintOrder) {
to->paintOrder = from->paintOrder; to->paintOrder = from->paintOrder;
} }