#4036 - Kaufoptionen

This commit is contained in:
Lorenz Hilpert
2023-05-09 10:33:21 +02:00
parent 4c7b5eec38
commit d2fb3b6c85

View File

@@ -43,7 +43,7 @@ export class ScaleContentComponent implements AfterContentInit {
fontSizeInEm = 1;
adjustmentSteps = 0.1;
adjustmentSteps = 0.05;
constructor(private _elementRef: ElementRef<HTMLElement>, private _renderer: Renderer2) {}
@@ -54,10 +54,12 @@ export class ScaleContentComponent implements AfterContentInit {
adjustFontSize() {
const element = this._elementRef.nativeElement;
const clientRect = element.getClientRects();
const scrollHeight = element.scrollHeight;
const clientRect = element?.getClientRects();
const scrollHeight = element?.scrollHeight;
if (clientRect[0].height < scrollHeight) {
const domRect = clientRect && clientRect[0];
if (domRect && domRect?.height < scrollHeight) {
this.fontSizeInEm -= this.adjustmentSteps;
} else {
return;