diff --git a/CHANGELOG.md b/CHANGELOG.md index 18068da..1a0ebe1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ # Change Log +## 1.1.1 + +* Floor the optimal `font-size` to avoid rounding errors. Thanks to @Robinfr for PR #2. + ## 1.1.0 -* Support `lineheight` +* Support `line-height` ## 1.0.0 diff --git a/package.json b/package.json index 27e5f26..4893ccc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fancy-textfill", - "version": "1.1.0", + "version": "1.1.1", "description": "Fast implementation for resizing text to fill its container.", "main": "index.js", "repository": "https://github.com/fazouane-marouane/fancy-textfill", diff --git a/src/index.ts b/src/index.ts index 0a6a5f1..e0c0810 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,9 +22,6 @@ function fontInfo(element: HTMLElement): FontInfo { let matchs = lineHeight.match(/^(\d+(?:.?\d+))(\w*)$/)!; lineHeightRatio = parseFloat(matchs[1]); switch(matchs[2]) { - case 'pt': - lineHeightRatio /= 10; - break; case '%': lineHeightRatio /= 100; break;