Re: [whatwg] Canvas stroke alignment

<FDD22B74-A5D7-4138-840F-1DA1D0C3B126@mikewilcox.net>

Current votes: None.

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
http://clubajax.org
mike@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.
>=20
> 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.
>=20
> --
> Nick Stakenburg