From 9d1c894484dac4f58e445296d32e519503794da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Balet?= Date: Mon, 30 Jun 2025 10:52:09 +0200 Subject: [PATCH] feat(height, width): accept string --- .../angularx-qrcode/src/lib/angularx-qrcode.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/angularx-qrcode/src/lib/angularx-qrcode.component.ts b/projects/angularx-qrcode/src/lib/angularx-qrcode.component.ts index 5d946e0..d647c61 100644 --- a/projects/angularx-qrcode/src/lib/angularx-qrcode.component.ts +++ b/projects/angularx-qrcode/src/lib/angularx-qrcode.component.ts @@ -40,8 +40,8 @@ export class QRCodeComponent implements OnChanges { @Input() public errorCorrectionLevel: QRCodeErrorCorrectionLevel = "M" @Input() public imageSrc?: string - @Input() public imageHeight?: number - @Input() public imageWidth?: number + @Input() public imageHeight?: number | string + @Input() public imageWidth?: number | string @Input() public margin = 4 @Input() public qrdata = "" @Input() public scale = 4 @@ -195,8 +195,8 @@ export class QRCodeComponent implements OnChanges { } const centerImageSrc = this.imageSrc - const centerImageHeight = this.imageHeight || 40 - const centerImageWidth = this.imageWidth || 40 + const centerImageHeight = this.imageHeight ? +this.imageHeight : 40 + const centerImageWidth = this.imageWidth ? +this.imageWidth : 40 switch (this.elementType) { case "canvas": {