W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2010

[whatwg] Canvas stroke alignment

From: Mike Wilcox <mike@mikewilcox.net>
Date: Mon, 19 Jul 2010 10:47:26 -0500
Message-ID: <FDD22B74-A5D7-4138-840F-1DA1D0C3B126@mikewilcox.net>
Wow, that would be so enormously useful. You make a shape, add a shape inside of it that is 100x100, add a stroke, get the width and it's 101. This "error" cascades, and shifts your items around on redraw. The math workaround is not easy.

FWIW, Photoshop uses "position" for this option (I don't believe Flash supports this).
I don't think the CSS3 box-sizing:border-box helps.

Does voting count? +1!

Mike Wilcox
mike at mikewilcox.net

On Jul 19, 2010, at 10:08 AM, Nick wrote:

> Canvas would benefit from a way to set stroke alignment. With the only available alignment being center, which is not very useful, custom paths have to be drawn to mimic inside and outside stroke alignment. That workaround may give unwanted transparency on pixels between a path and its stroke path once a path goes diagonal or curves.
> Having Canvas take care of stroke alignment (center, inside and outside) by adding something like strokeAlign can fix these transparency problems and makes adding strokes a lot easier and more useful.
> --
> Nick Stakenburg
Received on Monday, 19 July 2010 08:47:26 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:25 UTC