Open drukepple opened 8 years ago
Thank you @drukepple for your contribution. Ok good catch with the em issue, I just prefer to round with Math.round or something like that, because it's very not natural to have height like 12.3pixel or 43.2pixel.
Can you create at least one test to explain and fixe the issue?
👍
At line 416
maxHeight
is calculated byparseInt(this.options.lineHeight, 10)
. IflineHeight
is set to something like1.2em
, for some font sizes it becomes a computed value of something like21.6px
.parseInt
then floors this value, making it21
.If
lines
is then set to2
,maxHeight
becomes42
, which actually will truncate to 1 line.If
lineHeight
isparseFloated
, on the other hand,maxHeight
becomes43.2
, and the truncation is applied at 2 lines.My workaround for now is to do this math myself and set
options.maxHeight
manually.