Skip to content

maxHeight calculation should not use parseInt #31

@drukepple

Description

@drukepple

At line 416 maxHeight is calculated by parseInt(this.options.lineHeight, 10). If lineHeight is set to something like 1.2em, for some font sizes it becomes a computed value of something like 21.6px. parseInt then floors this value, making it 21.

If lines is then set to 2, maxHeight becomes 42, which actually will truncate to 1 line.

If lineHeight is parseFloated, on the other hand, maxHeight becomes 43.2, and the truncation is applied at 2 lines.

My workaround for now is to do this math myself and set options.maxHeight manually.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions