W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2014

[whatwg] Canvas normalize rect() and strokeRect()

From: Dirk Schulze <dschulze@adobe.com>
Date: Sat, 5 Apr 2014 16:01:19 +0000
To: WHAT Working Group <whatwg@whatwg.org>
Message-ID: <3709B668-C951-4013-9907-A07A04C4DA9A@adobe.com>

I looked at the behavior of negative width or height for the rect() and strokeRect() functions.

All browsers normalize the passed parameters for strokeRect() to have positive width and height.

strokeRect(90,10,-80,80) ó> strokeRect(10,10,80,80)


Just WebKit seems to normalize for rect() as well:


The behavior of normalizing is not specified. Especially it seems odd that the behavior for fillRect()/strokeRect() should differ from rect(). So we should either normalize for all functions or donít do it for all IMO.

Note: fillRect() and clearRect() are not affected. The behavior for rect() is important for filling with different winding rules as well. It is not just stroking with dash arrays that is effected.

Received on Saturday, 5 April 2014 16:01:48 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:19 UTC