[Bug 19026] New: I would like to see a clearPath or clearStroke functions similar to clearRect but to clear lines, not just full rectangles

https://www.w3.org/Bugs/Public/show_bug.cgi?id=19026

           Summary: I would like to see a clearPath or clearStroke
                    functions similar to clearRect but to clear lines, not
                    just full rectangles
           Product: HTML WG
           Version: unspecified
          Platform: All
               URL: http://www.whatwg.org/specs/web-apps/current-work/#com
                    plex-shapes-(paths)
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: HTML5 spec
        AssignedTo: dave.null@w3.org
        ReportedBy: contributor@whatwg.org
         QAContact: public-html-bugzilla@w3.org
                CC: ian@hixie.ch, mike@w3.org,
                    public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org, jackalmage@gmail.com


This was was cloned from bug 11739 as part of operation LATER convergence.
Originally filed: 2011-01-11 22:51:00 +0000

================================================================================
 #0   contributor@whatwg.org                          2011-01-11 22:51:44 +0000 
--------------------------------------------------------------------------------
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
================================================================================
 #1   Tab Atkins Jr.                                  2011-01-11 23:00:52 +0000 
--------------------------------------------------------------------------------
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.
================================================================================
 #2   Ian 'Hixie' Hickson                             2011-02-11 01:27:04 +0000 
--------------------------------------------------------------------------------
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.
================================================================================
 #3   Ian 'Hixie' Hickson                             2011-02-11 01:33:19 +0000 
--------------------------------------------------------------------------------
> Change Description: see diff given below

That should read "none yet", my apologies.
================================================================================
 #5   Ian 'Hixie' Hickson                             2012-02-29 22:11:36 +0000 
--------------------------------------------------------------------------------
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...
================================================================================
 #6   Tab Atkins Jr.                                  2012-02-29 22:16:00 +0000 
--------------------------------------------------------------------------------
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.
================================================================================
 #7   Ian 'Hixie' Hickson                             2012-02-29 22:45:06 +0000 
--------------------------------------------------------------------------------
I guess that makes sense.

So basically this is just a shorthand for:

   .save();
   .clip();
   .setTranform(identity)
   .clearRect(entire canvas)
   .restore();

...?
================================================================================
 #8   Tab Atkins Jr.                                  2012-02-29 22:46:39 +0000 
--------------------------------------------------------------------------------
Yup.
================================================================================
 #9   Ian 'Hixie' Hickson                             2012-02-29 22:54:52 +0000 
--------------------------------------------------------------------------------
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.
================================================================================

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 25 September 2012 21:55:36 UTC