mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 22:59:14 +00:00
refactor: revert back to content box size for this PR
This commit is contained in:
@@ -86,16 +86,15 @@ const resizeObserver = new ResizeObserver((entries) => {
|
||||
|
||||
if (!elementType || !elementId) continue
|
||||
|
||||
// Use borderBoxSize to match getBoundingClientRect() and element.style.width/height
|
||||
// This ensures consistency with manual resize operations
|
||||
const borderBox = Array.isArray(entry.borderBoxSize)
|
||||
? entry.borderBoxSize[0]
|
||||
: (entry.contentBoxSize?.[0] ?? {
|
||||
// Use contentBoxSize when available; fall back to contentRect for older engines/tests
|
||||
const contentBox = Array.isArray(entry.contentBoxSize)
|
||||
? entry.contentBoxSize[0]
|
||||
: {
|
||||
inlineSize: entry.contentRect.width,
|
||||
blockSize: entry.contentRect.height
|
||||
})
|
||||
const width = borderBox.inlineSize
|
||||
const height = borderBox.blockSize
|
||||
}
|
||||
const width = contentBox.inlineSize
|
||||
const height = contentBox.blockSize
|
||||
|
||||
// Screen-space rect
|
||||
const rect = element.getBoundingClientRect()
|
||||
|
||||
Reference in New Issue
Block a user