Skip to content

Commit

Permalink
if this works then Til is the GOAT
Browse files Browse the repository at this point in the history
try to fix that error
  • Loading branch information
THEkatinamicrowave authored Jan 15, 2025
2 parents 80a41a9 + 4fe2be3 commit 7bd599f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/flxsvg/FlxSvgSprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import format.svg.SVGRenderer;
import openfl.geom.Matrix;
import openfl.display.Shape;

using StringTools;

/**
* A sprite that supports rendering Scalable Vector Graphics (SVG) within HaxeFlixel.
* This class uses OpenFL to render SVG content into a Flixel sprite, allowing for scalable,
Expand Down Expand Up @@ -107,7 +109,7 @@ class FlxSvgSprite extends FlxSprite
{
final xmlData:Xml = svgData.getXml();

if (xmlData.firstElement() != null && xmlData.firstElement().nodeName != 'svg' && xmlData.firstElement().nodeName != 'svg:svg')
if (xmlData.firstElement() != null && !['svg', 'svg:svg'].contains(xmlData.firstElement().nodeName))
{
FlxG.log.error('Not an SVG file (${xmlData.firstElement().nodeName})');
return this;
Expand Down

0 comments on commit 7bd599f

Please sign in to comment.