Re: [geometry] DOMRect: allowing negative height/width

On Sat, Oct 15, 2016 at 2:47 PM, Simon Fraser <smfr@me.com> wrote:

> https://drafts.fxtf.org/geometry/#DOMRect
>
> Allowing negative height and width leads to additional complexity in the
> implementation that I don’t see a compelling use case for, and prevents
> DOMRect being implemented in terms of existing Rect classes that always
> normalize rectangles to have zero or positive height and width.
>
> Since the arguments allow negative height and width, we could add a
> normalization step that either clamps negative values to zero, or
> normalizes the rect by recomputing x and y.
>

We allowed negative width and height because it's already allowed in Canvas
2D [1] and it's a useful construct to have (ie if you want to change the
winding of the path)



1: https://www.w3.org/TR/2dcontext/#dom-context-2d-fillrect

Received on Sunday, 16 October 2016 16:40:47 UTC