Do not draw image with width or height < 0.5

This commit is contained in:
Bobo Häggström
2018-10-11 15:22:48 +02:00
parent da41515944
commit dded939a07
2 changed files with 16 additions and 3 deletions

View File

@@ -63,8 +63,10 @@ class IntermediateCanvasRenderer extends CanvasLayerRenderer {
const dy = imageTransform[5];
const dw = image.width * imageTransform[0];
const dh = image.height * imageTransform[3];
context.drawImage(image, 0, 0, +image.width, +image.height,
Math.round(dx), Math.round(dy), Math.round(dw), Math.round(dh));
if (dw >= 0.5 && dh >= 0.5) {
context.drawImage(image, 0, 0, +image.width, +image.height,
Math.round(dx), Math.round(dy), Math.round(dw), Math.round(dh));
}
context.globalAlpha = alpha;
if (clipped) {