From d2c866d8c2c58c778864e855da656d849cbe9785 Mon Sep 17 00:00:00 2001 From: Parth Jansari Date: Sat, 26 Oct 2024 12:04:07 +0530 Subject: [PATCH] added bug fix --- .../components/logo-wrapper/logo-wrapper.component.html | 2 +- src/app/components/logo-wrapper/logo-wrapper.component.ts | 7 ++++++- .../components/logos/gdg-inline/gdg-inline.component.html | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/components/logo-wrapper/logo-wrapper.component.html b/src/app/components/logo-wrapper/logo-wrapper.component.html index de389b0..ff03719 100644 --- a/src/app/components/logo-wrapper/logo-wrapper.component.html +++ b/src/app/components/logo-wrapper/logo-wrapper.component.html @@ -11,7 +11,7 @@ }
@if (isBrowser && config.alignment) { - + }
diff --git a/src/app/components/logo-wrapper/logo-wrapper.component.ts b/src/app/components/logo-wrapper/logo-wrapper.component.ts index 7b0bc24..8923463 100644 --- a/src/app/components/logo-wrapper/logo-wrapper.component.ts +++ b/src/app/components/logo-wrapper/logo-wrapper.component.ts @@ -22,6 +22,8 @@ import {GdgInlineComponent} from "../logos/gdg-inline/gdg-inline.component"; export class LogoWrapperComponent implements AfterViewInit { @ViewChild('canvas') canvas: ElementRef; @ViewChild('wrapper') wrapper: ElementRef; + canvasHeight = 0; + canvasWidth = 0; context: CanvasRenderingContext2D; config: ConfigType & any = {} protected readonly Communities = Communities; @@ -33,6 +35,7 @@ export class LogoWrapperComponent implements AfterViewInit { this.isBrowser = isPlatformBrowser(platformId); this.configService.getConfig.subscribe(change => { this.config = change; + console.log(change) setTimeout(_ => { this.drawImage() }, 1000) @@ -43,10 +46,12 @@ export class LogoWrapperComponent implements AfterViewInit { } - onConfigChange(node: ElementRef) { if (!node) return; this.nodeRef = node; + this.canvasHeight = node.nativeElement.height.baseVal.value + this.canvasWidth = node.nativeElement.width.baseVal.value; + } drawImage() { diff --git a/src/app/components/logos/gdg-inline/gdg-inline.component.html b/src/app/components/logos/gdg-inline/gdg-inline.component.html index 406cf38..2128e3b 100644 --- a/src/app/components/logos/gdg-inline/gdg-inline.component.html +++ b/src/app/components/logos/gdg-inline/gdg-inline.component.html @@ -11,6 +11,7 @@ +