NEW 96015
2D canvas strokeRect: negative width or height should affect winding direction
https://bugs.webkit.org/show_bug.cgi?id=96015
Summary 2D canvas strokeRect: negative width or height should affect winding direction
Justin Novosad
Reported 2012-09-06 13:19:14 PDT
From whatwg strokeRect spec: "the path has a single subpath are four points, with coordinates (x, y), (x+w, y), (x+w, y+h), and (x, y+h), connected to each other in that order by straight lines" Emphasis on: "in that order" This means that if w is negative xor y is negative, then the vertices should be drawn in counter clockwise order. This has an effect on how line dashes are drawn. This is currently broken because CanvasRenderingContext2D::strokeRect calls validateRectForCanvas, which normalizes the rectangle to make w and h positive. When fixing the, care must be taken not to regress any of the graphics ports. The skia port of GraphicsContext is capable of handling negative w/h, haven't looked at the others yet.
Attachments
Example (379 bytes, text/html)
2014-04-05 08:33 PDT, Dirk Schulze
no flags
Dirk Schulze
Comment 1 2014-04-05 08:33:28 PDT
Created attachment 228677 [details] Example Example file.
Brent Fulgham
Comment 2 2022-07-18 14:23:01 PDT
WebKit still doesn't seem to handle this properly.
Radar WebKit Bug Importer
Comment 3 2022-07-18 14:23:12 PDT
Note You need to log in before you can comment on or make changes to this bug.