Closed Adjective-Object closed 2 years ago
At present pathfinder_canvas treats the offset of sx/sy in draw_subimage as offsets in the destination canvas's coordinate space (See #481).
In order to match the behaviour of the html canvas API, these should be treated as offsets in the source image's coordinate space.
This fixes https://github.com/servo/pathfinder/issues/481. You can check the implementation against https://github.com/Adjective-Object/pathfinder_canvas_drawimage_repro.
For a quick visual reference, in these before/after images, the right side is made with the web canvas API In firefox, and the left side is the equivalent code in pathfinder_canvas. Before: After:
At present pathfinder_canvas treats the offset of sx/sy in draw_subimage as offsets in the destination canvas's coordinate space (See #481).
In order to match the behaviour of the html canvas API, these should be treated as offsets in the source image's coordinate space.
This fixes https://github.com/servo/pathfinder/issues/481. You can check the implementation against https://github.com/Adjective-Object/pathfinder_canvas_drawimage_repro.
For a quick visual reference, in these before/after images, the right side is made with the web canvas API In firefox, and the left side is the equivalent code in pathfinder_canvas. Before:
After: ![image](https://user-images.githubusercontent.com/1174858/143279615-3504b1c9-b16b-4451-bc41-6978c22432ad.png)