Skip to content

Commit

Permalink
Merge pull request #4073 from traPtitech/fix/oversized_rattling
Browse files Browse the repository at this point in the history
画面拡大率が特定の値の時に、引用メッセージががたつく問題を修正
  • Loading branch information
nokhnaton committed Sep 27, 2023
2 parents cb841c8 + 623ed3a commit 49bd338
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/composables/dom/useBoxSize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ const useBoxSize = (
// borderBoxSizeはSafari 15.4+
if (entry.borderBoxSize) {
const box = entry.borderBoxSize[0]
height.value = box?.blockSize
width.value = box?.inlineSize
height.value = box?.blockSize ? Math.ceil(box?.blockSize) : undefined
width.value = box?.inlineSize ? Math.ceil(box?.inlineSize) : undefined
} else {
const box = entry.target.getBoundingClientRect()
height.value = box.height
width.value = box.width
height.value = Math.ceil(box.height)
width.value = Math.ceil(box.width)
}
} else {
// contentBoxSizeはSafari 15.4+
if (entry.contentBoxSize) {
const box = entry.contentBoxSize[0]
height.value = box?.blockSize
width.value = box?.inlineSize
height.value = box?.blockSize ? Math.ceil(box?.blockSize) : undefined
width.value = box?.inlineSize ? Math.ceil(box?.inlineSize) : undefined
} else {
const box = entry.target.getClientRects()[0]
height.value = box?.height
width.value = box?.width
height.value = box?.height ? Math.ceil(box?.height) : undefined
width.value = box?.width ? Math.ceil(box?.width) : undefined
}
}
})
Expand Down

0 comments on commit 49bd338

Please sign in to comment.