Skip to content

Commit

Permalink
Fix card scaling on very small sizes (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBartusek authored Mar 4, 2023
1 parent afe8c52 commit 31a642c
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/meteoalarm-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ export class MeteoalarmCard extends LitElement {
const minFontSize = scaleHeadline ? MIN_FONT_SIZE : MAX_FONT_SIZE;
for (let fontSize = MAX_FONT_SIZE; fontSize >= minFontSize; fontSize--) {
const elementSize = getTextWidth(element.textContent!, getCanvasFont(regular, fontSize + 'px'));
if(regular.clientWidth <= 0) isSizeSet = true;
if(elementSize <= regular.clientWidth) {
this.setCardScaling(slide, size as any, fontSize);
isSizeSet = true;
Expand Down

0 comments on commit 31a642c

Please sign in to comment.