Fix alignment of rotated image layers

This commit is contained in:
Andreas Hocevar
2022-07-15 20:20:31 +02:00
parent 720ccbcd42
commit 96e2400c46
4 changed files with 1 additions and 11 deletions

View File

@@ -252,17 +252,7 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
previousAlpha = context.globalAlpha; previousAlpha = context.globalAlpha;
context.globalAlpha = opacity; context.globalAlpha = opacity;
} }
context.drawImage( context.drawImage(img, 0, 0, +img.width, +img.height, dx, dy, dw, dh);
img,
0,
0,
+img.width,
+img.height,
Math.round(dx),
Math.round(dy),
Math.round(dw),
Math.round(dh)
);
if (opacity !== 1) { if (opacity !== 1) {
context.globalAlpha = previousAlpha; context.globalAlpha = previousAlpha;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 21 KiB