mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
tvgSvgLoader: Add points copy of missing polygon/polyline
When using <use> node, do atrribute copy. At that time, when target(url) is polygon or polyline, points array is not copied, causing a problem in output. So, add missing array copy.
This commit is contained in:
parent
098c94819c
commit
77ccbcc6fe
1 changed files with 4 additions and 2 deletions
|
@ -1546,12 +1546,14 @@ static void _copyAttr(SvgNode* to, SvgNode* from)
|
|||
}
|
||||
case SvgNodeType::Polygon: {
|
||||
to->node.polygon.pointsCount = from->node.polygon.pointsCount;
|
||||
to->node.polygon.points = (float*)calloc(to->node.polygon.pointsCount, sizeof(float));
|
||||
to->node.polygon.points = (float*)malloc(to->node.polygon.pointsCount * sizeof(float));
|
||||
memcpy(to->node.polygon.points, from->node.polygon.points, to->node.polygon.pointsCount * sizeof(float));
|
||||
break;
|
||||
}
|
||||
case SvgNodeType::Polyline: {
|
||||
to->node.polyline.pointsCount = from->node.polyline.pointsCount;
|
||||
to->node.polyline.points = (float*)calloc(to->node.polyline.pointsCount, sizeof(float));
|
||||
to->node.polyline.points = (float*)malloc(to->node.polyline.pointsCount * sizeof(float));
|
||||
memcpy(to->node.polyline.points, from->node.polyline.points, to->node.polyline.pointsCount * sizeof(float));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
|
Loading…
Add table
Reference in a new issue