Skip to content

Commit

Permalink
Merge pull request #41 from github/round_border_widths
Browse files Browse the repository at this point in the history
Round border widths to nearest int
  • Loading branch information
camertron authored Nov 30, 2023
2 parents 684725e + 9aa4ee7 commit 780c32d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export default function autosize(textarea, {viewportMarginBottom = 100} = {}) {

const textareaStyle = getComputedStyle(textarea)

const topBorderWidth = parseFloat(textareaStyle.borderTopWidth)
const bottomBorderWidth = parseFloat(textareaStyle.borderBottomWidth)
const topBorderWidth = Math.ceil(parseFloat(textareaStyle.borderTopWidth))
const bottomBorderWidth = Math.ceil(parseFloat(textareaStyle.borderBottomWidth))

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

0 comments on commit 780c32d

Please sign in to comment.