Skip to content
Snippets Groups Projects
Commit d77e5664 authored by rhenck's avatar rhenck
Browse files

Set default line height for likert and text

It is okay to discard a 0 value here, as 0 line height makes no sense 
and it is better to use the default.
parent 3be077dd
No related branches found
No related tags found
No related merge requests found
......@@ -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 ||
......
......@@ -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 ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment