ctx.fill() uses even-odd instead of non-zero winding rule #51

Closed
phoboslab opened this Issue Nov 3, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@phoboslab
Owner

phoboslab commented Nov 3, 2012

The EJPath drawPolygonsToContext method uses the even-odd rule to fill shapes, whereas the Canvas spec dictates use of the non-zero winding rule. See http://en.wikipedia.org/wiki/Nonzero-rule

Implementing the non-zero rule with the stencil buffer would entail the following (I think): Draw to the stencil buffer twice: once for all back-facing polygons, while increasing the stencil buffer, and once for all front-facing polygons, while decreasing the stencil buffer. This would also mean that we'd have to clear the stencil buffer (or the area that we used) afterwards.

Ideas?

Edit: after a bit of googling I found this implementation: http://devel.aegisub.org/changeset/42e4e3e56a5f46e4e4cb83c300813fd675a9a059/src/visual_tool_vector_clip.cpp

@phoboslab phoboslab referenced this issue Nov 3, 2012

Closed

need ctx.clip #33

@phoboslab phoboslab closed this in 16429ca Nov 3, 2012

@amerkoleci

This comment has been minimized.

Show comment Hide comment
@amerkoleci

amerkoleci Dec 13, 2013

HTML5 canvas fill method supports setting fill rule, does ejecta supports this? or only non-zero winding rule?

HTML5 canvas fill method supports setting fill rule, does ejecta supports this? or only non-zero winding rule?

@phoboslab

This comment has been minimized.

Show comment Hide comment
@phoboslab

phoboslab Dec 15, 2013

Owner

No, it's not supported.

What's the current API proposal for changing the winding rule? Is there an official spec already? Couldn't find anything conclusive.

Please open a new issue to get this tracked properly.

Owner

phoboslab commented Dec 15, 2013

No, it's not supported.

What's the current API proposal for changing the winding rule? Is there an official spec already? Couldn't find anything conclusive.

Please open a new issue to get this tracked properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment