diff --git a/projects/common/ui-elements/likert/likert-element.ts b/projects/common/ui-elements/likert/likert-element.ts index 940e50450a544efefa5d7540b674ce43f6cfcdcf..1facc2b22f4566e0e37addb3a39c080532c672bc 100644 --- a/projects/common/ui-elements/likert/likert-element.ts +++ b/projects/common/ui-elements/likert/likert-element.ts @@ -44,6 +44,11 @@ export class LikertElement extends CompoundElement implements PositionedElement, } else { this.positionProps.marginBottom = 30; } + // it is okay to discard a 0 value here, as 0 line height makes no sense and it is better to use the default. + this.fontProps.lineHeight = + serializedElement.fontProps?.lineHeight as number || + serializedElement.lineHeight as number || + 135; this.surfaceProps.backgroundColor = (serializedElement as unknown as SurfaceElement).surfaceProps?.backgroundColor as string || serializedElement.backgroundColor as string || diff --git a/projects/common/ui-elements/text/text-element.ts b/projects/common/ui-elements/text/text-element.ts index dd9798d5b3870391f8f984170f1e2c87708d7fea..1d4ab620860a0e84c5e9174c4880210118cdb572 100644 --- a/projects/common/ui-elements/text/text-element.ts +++ b/projects/common/ui-elements/text/text-element.ts @@ -26,6 +26,12 @@ export class TextElement extends UIElement implements PositionedElement, FontEle this.surfaceProps = initSurfaceElement(serializedElement); this.height = serializedElement.height || 98; + // it is okay to discard a 0 value here, as 0 line height makes no sense and it is better to use the default. + this.fontProps.lineHeight = + serializedElement.fontProps?.lineHeight as number || + serializedElement.lineHeight as number || + 135; + this.surfaceProps.backgroundColor = serializedElement.surfaceProps?.backgroundColor as string || serializedElement.backgroundColor as string ||