diff --git a/src/Svg.ts b/src/Svg.ts index bc25ea0..f6aea47 100644 --- a/src/Svg.ts +++ b/src/Svg.ts @@ -2303,9 +2303,16 @@ export class SVGDrawing { calculateLogoDimensionsModuleApproach() { let logoHeight , logoWidth , logoAreaWidth , logoAreaHeight; + let logoScale = this.config.logoScale ; let logoMargin = this.config.logoMargin ; let rectangular = this.config.rectangular ; + if (logoScale <= 0 || logoScale >= 1) { + logoScale = 0.2 ; + } + if( logoMargin < 0 || logoMargin > 100 ){ + logoMargin = 50 ; + } // Calibrating logo margin to avoid small logos // ( This will ensure at least 50% area of logo is covered by the actual logo) logoMargin = 0.5 * logoMargin @@ -2364,8 +2371,8 @@ export class SVGDrawing { } - logoAreaHeight = ( this.config.logoScale / maxLogoScale ) * logoAreaHeight ; - logoAreaWidth = ( this.config.logoScale / maxLogoScale ) * logoAreaWidth ; + logoAreaHeight = ( logoScale / maxLogoScale ) * logoAreaHeight ; + logoAreaWidth = ( logoScale / maxLogoScale ) * logoAreaWidth ; this.calculatedLogoAreaHeight = logoAreaHeight ; this.calculatedLogoAreaWidth = logoAreaWidth ;