- From: Igor Trindade Oliveira <itrindade.oliveira@gmail.com>
- Date: Thu, 21 Jun 2012 09:59:07 -0700
- To: whatwg@lists.whatwg.org
Currently, canvas2d does not have support for rounded rectangles and the web developers are implementing rounded rectangles using arcs or bezier curves.[1][2] So i propose the addition of two new functions: void fillRoundedRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h, unrestricted double xRadius, unrestricted double yRadius); void strokeRoundedRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h, unrestricted double xRadius, unrestricted double yRadius); Where the xRadius and yRadius arguments specify the radii of the ellipses defining the corners of the rounded rectangle. Additionally, if we know that the path is a rounded rectangle, we can make optimizations in the graphics libraries reducing the amount of tesselations. [1] http://www.scriptol.com/html5/canvas/rounded-rectangle.php [2] http://www.supercalifrigginawesome.com/Extending-Canvas-to-Draw-Rounded-Rectangles
Received on Thursday, 21 June 2012 17:03:25 UTC