Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ function getWH(elem, name, ex) {
const which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
let borderBoxValue =
name === 'width'
? Math.floor(elem.getBoundingClientRect().width)
: Math.floor(elem.getBoundingClientRect().height);
? Math.ceil(elem.getBoundingClientRect().width)
: Math.ceil(elem.getBoundingClientRect().height);
const isBorderBox = isBorderBoxFn(elem);
let cssBoxValue = 0;
if (
Expand All @@ -478,7 +478,7 @@ function getWH(elem, name, ex) {
cssBoxValue = elem.style[name] || 0;
}
// Normalize '', auto, and prepare for extra
cssBoxValue = Math.floor(parseFloat(cssBoxValue)) || 0;
cssBoxValue = Math.ceil(parseFloat(cssBoxValue)) || 0;
}
if (extra === undefined) {
extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
Expand Down