Merge pull request #8805 from notnotse/issue/8700-tile-scaled-below-zero

Do not draw image with width or height < 0.5
This commit is contained in:
Andreas Hocevar
2018-10-11 19:40:41 +02:00
committed by GitHub
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) {