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 Multipage: http://www.whatwg.org/C#path-objects Complete: http://www.whatwg.org/c#path-objects Comment: There are many references to "the last point in the path". Please provide a function (or clear documentation) to GET this last point's coordinates. This would also help in the canvas lineTo() and moveTo() when you need to figure out where the current point is. Posted from: 96.226.222.9 User agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20100101 Firefox/14.0.1
What's the use case? Don't you always know what the last point is, by virtue of having just added it?
(not the original bug author) Answering both questions: A possible use case would be figuring out the end point of an arcTo path segment, where, by the specification, you may not know where that point is.
Interesting. When would you need to know that point?
Are there any browser vendors who would like to implement this?
Sorry for taking so long to get back. Answering question on #3: Example: Imagine that you're drawing a balloon text: /-------\ | Hi! | \--v----/ Where / and \ have been drawn with arcTo. If you want to draw the pointy thingy below, it will be nice to know where did the last arcTo ended. Knowing the last point would also be welcome when calculating more complex paths.
What would you actually do with the knowledge? Wouldn't you basically always just draw a straight line to where you want the tail to start, then draw the tail, then resume? Also, in the case of an axis-aligned rectangular speech bubble, you know where the end point of the arc will be: exactly /radius/ units away from the corner point, in the direction of the second point from the corner point. Could you maybe post an example of how you would use this, where you've stubbed out the "getLastPoint()" function to return the predetermined right values?
Closing issue due to lack of implementer interest. To re-open, please enter a new issue at https://github.com/whatwg/html/issues