[webkit-dev] new APIs for strokes with dash in Canvas
Darin Fisher
darin at chromium.org
Thu Sep 22 21:27:24 PDT 2011
Do you know if anyone is working to add this to the spec for Canvas? It
seems like it may not take much to get it added, given that FF already has
an implementation.
-Darin
On Thu, Sep 22, 2011 at 7:31 PM, Young Han Lee <joybro201 at gmail.com> wrote:
> Hi all,
>
> I have a patch to add webkitLineDash and webkitLineDashOffset APIs on
> CanvasRenderingContext2D on https://bugs.webkit.org/show_bug.cgi?id=63933
>
> The purpose of these APIs is to support for strokes with dash in Canvas.
>
> Although the API is not specified in the HTML Canvas specification yet, I
> believe it would be great to support the API. As Dirk said in the above bug,
> Mozilla already implemented the APIs named mozDash and mozDashOffset[1], and
> there seems to be many needs for the API. Some people even implemented their
> own javascript functions to draw strokes with dash in Canvas[2,3].
>
> As GraphicsContext already have an interface for strokes with dash,
> setLineDash, all we have to do is exposing it to the JS level. So the syntax
> and meaning of the new APIs is the same with the arguments of the
> setLineDash. webkitLineDash is an array of float, and webkitLineDashOffset
> is a float.
>
> I uploaded a patch for JSC first. After the patch is landed, I will make a
> follow-up patch for V8.
>
> Any thought?
>
>
> [1] https://bugzilla.mozilla.org/show_bug.cgi?id=662038
> [2]
> http://davidowens.wordpress.com/2010/09/07/html-5-canvas-and-dashed-lines/
> [3]
> http://stackoverflow.com/questions/7352769/dashed-curves-on-html5-canvas-bezier
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20110922/f5cf4a47/attachment.html>
More information about the webkit-dev
mailing list