Here is the sample of the rings:
var ring = new Sprite();
ring.graphics.beginFill(0x24AFC4);
ring.graphics.drawRect (0, 0, 120, 100);
ring.graphics.drawRect (10, 10, 100, 80);
ring.graphics.endFill();
ring.x = 20;
ring.y = 380;
addChild(ring);
var ringPath = new Sprite();
ringPath.graphics.beginFill(0x24AFC4);
ringPath.graphics.drawPath(
flash.Vector.ofArray([
GraphicsPathCommand.LINE_TO,
GraphicsPathCommand.LINE_TO,
GraphicsPathCommand.LINE_TO,
GraphicsPathCommand.LINE_TO,
GraphicsPathCommand.MOVE_TO,
GraphicsPathCommand.LINE_TO,
GraphicsPathCommand.LINE_TO,
GraphicsPathCommand.LINE_TO,
GraphicsPathCommand.LINE_TO
]), flash.Vector.ofArray([
120.0, 0, 120, 100, 0, 100, 0, 0,
10, 10,
110, 10, 110, 90, 10, 90, 10, 10
]));
ringPath.graphics.endFill();
ringPath.x = 160;
ringPath.y = 380;
addChild(ringPath);
The results:
- HTML5 - works wrong;
- MAC - works OK;
- MAC (legacy) - drawRect doesn’t work, drawPath works OK.
The screenshots are on the page of the issue on github - https://github.com/openfl/openfl/issues/888.
I’ve also found some solution for the HTML. You can found it there.
Maybe somebody experienced the same issue and found a better solution?