Skip to content

Commit 780c32d

Browse files
authored
Merge pull request #41 from github/round_border_widths
Round border widths to nearest int
2 parents 684725e + 9aa4ee7 commit 780c32d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ export default function autosize(textarea, {viewportMarginBottom = 100} = {}) {
5050

5151
const textareaStyle = getComputedStyle(textarea)
5252

53-
const topBorderWidth = parseFloat(textareaStyle.borderTopWidth)
54-
const bottomBorderWidth = parseFloat(textareaStyle.borderBottomWidth)
53+
const topBorderWidth = Math.ceil(parseFloat(textareaStyle.borderTopWidth))
54+
const bottomBorderWidth = Math.ceil(parseFloat(textareaStyle.borderBottomWidth))
5555

5656
const isBorderBox = textareaStyle.boxSizing === 'border-box'
5757
const borderAddOn = isBorderBox ? topBorderWidth + bottomBorderWidth : 0

0 commit comments

Comments
 (0)