W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > July 2011

[Bug 13277] New: canvas '2d' context needs a getter for current point in path

From: <bugzilla@jessica.w3.org>
Date: Sat, 16 Jul 2011 17:25:45 +0000
To: public-html-bugzilla@w3.org
Message-ID: <bug-13277-2486@http.www.w3.org/Bugs/Public/>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=13277

           Summary: canvas '2d' context needs a getter for current point
                    in path
           Product: HTML.next
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: default
        AssignedTo: dave.null@w3.org
        ReportedBy: phorgan1@gmail.com
         QAContact: public-html-bugzilla@w3.org
                CC: plh@w3.org, mike@w3.org


Several methods in the '2d' context are of the To variety, for example moveTo,
lineTo, and arcTo which take as an implicit first argument the current point in
the path being constructed.  It's not possible to make similar methods from
javascript if you need to do something to the end at the initial point, because
it's not possible to find out what that point is.  As an example, if you wanted
to make an 
arrowTo(x,y,angle,which,length,type)
  (x,y) - destination of arrow
  angle - angle between shaft of line and barb of one side of arrow
  which - which end, could be 0,1,2,3
    0 would operate like lineTo 
    1 put arrow head on destination end
    2 put arrow head on source end
    3 both ends get arrow
  length - length of the arrow head
  type   - curved bezier or block straight line

You couldn't do it.  You don't know the originating current point in the path
and there's no way to ask for it.  Same would apply to arcArrowTo.  It forces
you to ask the user to supply both points.

Here's
http://stackoverflow.com/questions/4577410/find-current-point-on-path-for-html-canvas-context
a link to someone else who wants the current point to be able to do a dashTo.  

I could create a wrapper around the context and have my uber context keep track
of the information, but adding one getter to the context2d would solve the
problem.

context2d.currentPoint or perhaps currentPointX, and currentPointY

Thanks:)
Patrick

-- 
Configure bugmail: http://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 Saturday, 16 July 2011 17:25:47 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 16:31:13 UTC