fix renderBackgroundImage When receiving an image with 0 width or height

This commit is contained in:
Dani 2022-06-03 08:53:36 +02:00
parent 6020386bbe
commit 190c7b63ee
1 changed files with 6 additions and 3 deletions

View File

@ -595,10 +595,13 @@ export class CanvasRenderer extends Renderer {
}
if (image) {
let widthTmp = Math.max(1, image.width);
let heightTmp = Math.max(1, image.height);
const [path, x, y, width, height] = calculateBackgroundRendering(container, index, [
image.width,
image.height,
image.width / image.height
widthTmp,
heightTmp,
widthTmp / heightTmp
]);
const pattern = this.ctx.createPattern(
this.resizeImage(image, width, height),