Fix ResizeObserver loop in some situations

This is caused by 7486360390.

Not sure why it happens, and it only occurs in WebKit. Truncating the
padding seems to be the fix.
This commit is contained in:
John Factotum
2023-05-02 01:35:43 +08:00
parent faaa2f47d4
commit 604a8caf3b
+2 -2
View File
@@ -434,7 +434,7 @@ export class Paginator {
const { width, height } = this.#container.getBoundingClientRect()
const size = vertical ? height : width
const gap = gape * size
const gap = Math.trunc(gape * size)
this.heads = null
this.feet = null
@@ -447,7 +447,7 @@ export class Paginator {
this.#maxSizeContainer.style.maxWidth = `${maxColumns * maxColumnWidth}px`
const { width, height } = this.#container.getBoundingClientRect()
const size = vertical ? height : width
const gap = gape * size
const gap = Math.trunc(gape * size)
const divisor = Math.ceil(size / maxColumnWidth)
const columnWidth = (size / divisor) - gap
this.#element.setAttribute('dir', rtl ? 'rtl' : 'ltr')