Happy to submit a fix for this, but I want to confirm if the behaviour is intentional or not first:
If you create a pattern from an image, then immediately call CanvasRenderingContext2D.draw_subimage, The x/y components of the input rect are in the destination canvas' coordinate space, while the width/height are in the image's own coordinate space.
Happy to submit a fix for this, but I want to confirm if the behaviour is intentional or not first:
If you create a pattern from an image, then immediately call CanvasRenderingContext2D.draw_subimage, The x/y components of the input rect are in the destination canvas' coordinate space, while the width/height are in the image's own coordinate space.
https://github.com/servo/pathfinder/blob/20adbeed149713ae4354cede3a30ca0f622c9943/canvas/src/lib.rs#L553-L556
I assume this API is meant to be analagous to
ctx.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);
, which from MDN takes the whole rect (including offset) from the image's own coordinate space.