Revert "loader/svg: Skip to invalid polygon"

This reverts commit 75e587a9a9.
If incorrect data for the points in a polygon is provided,
the element should still be rendered, but only up to the point
where the error occurs—using an even number of the points that
have been successfully loaded.
This commit is contained in:
Mira Grudzinska 2024-04-21 20:33:12 +02:00 committed by Hermet Park
parent 0ae98e7f31
commit c5266725d4
2 changed files with 1 additions and 6 deletions

View file

@ -1726,10 +1726,6 @@ static bool _attrParsePolygonPoints(const char* str, SvgPolygonNode* polygon)
{
float num;
while (_parseNumber(&str, nullptr, &num)) polygon->pts.push(num);
if (polygon->pts.count % 2 != 0) {
polygon->pts.clear();
return false;
}
return true;
}
@ -1772,7 +1768,7 @@ static SvgNode* _createPolygonNode(SvgLoaderData* loader, SvgNode* parent, const
if (!loader->svgParse->node) return nullptr;
if (!func(buf, bufLength, _attrParsePolygonNode, loader)) return nullptr;
func(buf, bufLength, _attrParsePolygonNode, loader);
return loader->svgParse->node;
}

View file

@ -358,7 +358,6 @@ bool simpleXmlParseAttributes(const char* buf, unsigned bufLength, simpleXMLAttr
if (!func((void*)data, tmpBuf, tval)) {
if (!_isIgnoreUnsupportedLogAttributes(tmpBuf, tval)) {
TVGLOG("SVG", "Unsupported attributes used [Elements type: %s][Id : %s][Attribute: %s][Value: %s]", simpleXmlNodeTypeToString(((SvgLoaderData*)data)->svgParse->node->type), ((SvgLoaderData*)data)->svgParse->node->id ? ((SvgLoaderData*)data)->svgParse->node->id : "NO_ID", tmpBuf, tval ? tval : "NONE");
goto error;
}
}
}