Cairo crash on valid SVG


#1

Trying to render this SVG with the code:

var debug = new Sprite();
addChild(debug);
var svg = new SVG(Assets.getText("assets/images/items/cannon.svg"));
svg.render(debug.graphics, 0, 0, 100, 100);

Is crashing Neko with

Called from sys.io.FileOutput::$statics line 1
Called from ApplicationMain::main line 30
Called from ApplicationMain::create line 147
Called from lime.app.Application::exec line 167
Called from lime._internal.backend.native.NativeApplication::exec line 163
Called from lime._internal.backend.native.NativeApplication::handleRenderEvent line 450
Called from lime.app._Event_lime_graphics_RenderContext_Void::dispatch line 101
Called from openfl.display.Stage::render line 1502
Called from openfl.display.OpenGLRenderer::__render line 816
Called from openfl.display.DisplayObjectContainer::__renderGL line 1174
Called from openfl.display.DisplayObjectContainer::__renderGL line 1174
Called from openfl.display.DisplayObjectContainer::__renderGL line 1174
Called from openfl.display.DisplayObjectContainer::__renderGL line 1161
Called from openfl.display.DisplayObject::__renderGL line 1731
Called from openfl._internal.renderer.context3D.Context3DShape::render line 50
Called from openfl._internal.renderer.context3D.Context3DGraphics::render line 525
Called from openfl._internal.renderer.cairo.CairoGraphics::render line 1397
Called from openfl._internal.renderer.cairo.CairoGraphics::endFill line 232
Called from openfl._internal.renderer.cairo.CairoGraphics::playCommands line 803
Called from openfl._internal.renderer.cairo.CairoGraphics::createGradientPattern line 149
Uncaught exception - Invalid operation (&)

On Haxe 3.4.7, nme 6.0.58, openfl 8.8.0, lime 7.2.1, svg 1.1.2.

On HTML target, the SVG draws without errors, but is missing all gradients. The SVG was exported from Gravit Designer for windows 10.

Any ideas?


#2

Fixed with https://github.com/openfl/svg/pull/65

Radial gradients still do not render correctly, however the crash at least is fixed and they are rendering to some degree.