Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect rendering of non-convex polygons in flash.display.Graphics #123

Closed
isohedral opened this issue Apr 27, 2014 · 1 comment
Closed

Comments

@isohedral
Copy link

It seems to me that OpenFL isn't correctly filling the interiors of some non-convex polygons (drawn using flash.display.Graphics). I'm appending a simple example here. When I run it with the latest lime toolchain, I clearly see that the stroke and fill of the shape don't match up. The shape should look like two pentagons glued together. But the filled region loses one of the indentations.

package;

import flash.display.Sprite;

class Main extends Sprite {
    static private var coords = [
        54.0512197394158, -39.2705098312484,
        25.5195242505612, -30,
        7.885966681787, -54.2705098312484,
        -20.6457288070676, -63.5410196624969,
        -20.6457288070676, -93.5410196624968,
        7.885966681787, -102.811529493745,
        25.5195242505612, -78.5410196624969,
        54.0512197394158, -69.2705098312484 ];

    public function new () {
        super ();

        var s = new Sprite();
        var g = s.graphics;

        g.lineStyle( 1.0, 0x000000, 1.0 );
        g.beginFill( 0xa0e0e0, 1.0 );

        g.moveTo( coords[0], coords[1] );
        var idx = 2;
        while( idx < coords.length ) {
            g.lineTo( coords[idx], coords[idx+1] );
            idx += 2;
        }

        g.endFill();

        s.x = 400;
        s.y = 400;
        addChild( s );
    }
}
@hughsando
Copy link
Member

This seems to be working in the git NME build. If there is still an issue with openfl/lime, please report it in the new Lime repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants