Open mhsmith opened 8 months ago
The transformation should also apply to the stroke width. This is happening on Cocoa, GTK and Android, but not on WinForms.
This cannot be done simply by multiplying the width by a constant. For example, if there are different scale factors in the X and Y dimensions, the stroke width of a circle will change continuously around its circumference.
```js ctx.lineWidth = 2 ctx.moveTo(0, 25) ctx.lineTo(50, 25) ctx.moveTo(25, 0) ctx.lineTo(25, 50) ctx.scale(3, 1) ctx.stroke() ``` | ```py ctx.move_to(0, 25) ctx.line_to(50, 25) ctx.move_to(25, 0) ctx.line_to(25, 50) ctx.scale(3, 1) ctx.stroke() ``` |
HTML (https://jsfiddle.net/mhsmith/21ehgadk/9/), and Toga on Cocoa and GTK:
Toga on Android:
Toga on WinForms:
Describe the bug
The HTML spec says that points "must be transformed according to the current transformation matrix before being added to the path".
Toga does this correctly on Cocoa and GTK, but on WinForms and Android it doesn't apply the matrix until the path is actually drawn, so the entire path is transformed with whatever happens to be the matrix at that moment.
HTML (https://jsfiddle.net/mhsmith/9ewqnvz5/14/), and Toga on Cocoa and GTK:
Toga on WinForms and Android:
Environment