haxelib svg rendering overlapped shapes

62 views
Skip to first unread message

Tom

unread,
Mar 21, 2014, 3:34:17 AM3/21/14
to haxe...@googlegroups.com

Hi!

There are any possibility to modify the haxelib.SVG library to render correctly the overlapped shapes?
Because like in this images shown, there are some undesirable holes in the white border.

Any idea is welcomed!
Tom

Juraj Kirchheim

unread,
Mar 21, 2014, 4:02:50 AM3/21/14
to haxe...@googlegroups.com

You will probably need to make your own subclass of GfxGraphics that doesn't call lineTo / curveTo directly, but instead accumulates them in a GraphicsPath (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/GraphicsPath.html) that is then flushed upon endFill, allowing you to use the correct pathwinding.

Best,
Juraj

Tom

unread,
Mar 21, 2014, 4:56:03 AM3/21/14
to haxe...@googlegroups.com
Yess!

It worked! Maybe I need to test on other svgs, but the upper one is correct now, thanks!
Tom

Hugh

unread,
Mar 21, 2014, 8:49:38 PM3/21/14
to haxe...@googlegroups.com

Do you have a test svg?  Have you tried the svg renderer in gm2d (available on haxelib) this has had a few improvements.

Hugh

Tom

unread,
Mar 22, 2014, 2:40:18 AM3/22/14
to haxe...@googlegroups.com
I have no public test svg, sorry. But I will test gm2d today - speed, and fill capability.

Tom

unread,
Mar 22, 2014, 5:25:57 AM3/22/14
to haxe...@googlegroups.com
Hi Hugh!

I suppose, that the gm2d svg renderer doesn't support 'fill-rule' attribute yet, like in the svg renderer in haxelib. The source of these two are similar.
I added some colour definition in SVGData.hx, to support 'white', 'black', etc. colour naming.
I try to add fill-rule support, and if it works, then i will post to public my version.
Reply all
Reply to author
Forward
0 new messages