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

Proposal: implement CanvasDrawPath.fillAndStroke() #518

Open
lehni opened this issue Jan 15, 2016 · 0 comments
Open

Proposal: implement CanvasDrawPath.fillAndStroke() #518

lehni opened this issue Jan 15, 2016 · 0 comments
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest

Comments

@lehni
Copy link

lehni commented Jan 15, 2016

I would like to suggest the addition of a method that performs both a fill and a stroke operation on the current path, or on the path passed to it, in a way that:

  • the path is filled first, then stroked
  • the properties of the CanvasCompositing interface (globalAlpha, globalCompositeOperation) as well as the CanvasShadowStyles interface (shadowOffsetX, shadowOffsetY, shadowBlur, shadowColor) are applied to the combined result of the operation, so that:
    • only the outside of the stroke has a shadow
    • the alpha value and other compositing options do not result in the stroke and the fill mixing, they only blend with what's underneath them.

The absence of such a possibility requires many hacks with double buffering, resulting in performance that's far from optimal. I believe that this simple addition would solve many situations that so far require such a hack.

void fillAndStroke(optional CanvasFillRule fillRule = "nonzero");
void fillAndStroke(Path2D path, optional CanvasFillRule fillRule = "nonzero");
@lehni lehni changed the title Proposal: implement CanvasRenderingContext2D.fillAndStroke() Proposal: implement CanvasDrawPath.fillAndStroke() Jan 15, 2016
@zcorpan zcorpan added the addition/proposal New features or enhancements label Jan 15, 2016
@domenic domenic added the needs implementer interest Moving the issue forward requires implementers to express interest label Jan 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest
Development

No branches or pull requests

3 participants