This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html Section: http://www.whatwg.org/specs/web-apps/current-work/complete.html#complex-shapes-(paths) Comment: I would like to see a clearPath or clearStroke functions similar to clearRect but to clear lines, not just full rectangles Posted from: 71.9.39.98
This can be achieved currently by making a path, calling clip(), *then* calling clearRect with a bounding rectangle specified. That technique is fairly unintuitive, though. A clear() method that clears out a path would be nice.
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document: http://dev.w3.org/html5/decision-policy/decision-policy.html Status: Partially Accepted Change Description: see diff given below Rationale: That might make sense, but in a future version.
> Change Description: see diff given below That should read "none yet", my apologies.
mass-move component to LC1
What's the use case for this, exactly? Having played with canvas quite a bit recently I've never found myself needing anything but clearRect() applied to the entire canvas...
I've used the technique I outlined in Comment #1 for a Worms-like game before. When your gun hit, I did a clearRect() (clipped to a path) to remove pixels from the "level" canvas.
I guess that makes sense. So basically this is just a shorthand for: .save(); .clip(); .setTranform(identity) .clearRect(entire canvas) .restore(); ...?
Yup.
I'm going to punt on this for now, and review it at a later date to see how much demand there has been for it. So far it seems like it would be little more than a convenience method and I haven't heard much demand for it.
This bug was cloned to create HTML WG bug 19026.
Any implementation interest on this? How compelling a use case is it? If it's not needed by many people, since it's only a convenience API essentially, maybe it's not worth doing?
Marking WONTFIX since it's gotten no vendor interest and it's equivalent to five lines of simple code anyway.