mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
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:
+2
-2
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user