收缩按钮
This commit is contained in:
1 parent
0f578d29a4
commit
67bf3921cc
9 files changed
+241
-86
No files matched your search
+5
-1
@@ -529,7 +529,11 @@ onMounted(async () => {
|
||||
el.appendChild(app.view as unknown as HTMLCanvasElement)
|
||||
stageResizeObserver = new ResizeObserver(() => {
|
||||
if (!app) return
|
||||
app.renderer.resize(Math.max(1, el.clientWidth), Math.max(1, el.clientHeight))
|
||||
const previousHeight = app.screen.height
|
||||
const nextHeight = Math.max(1, el.clientHeight)
|
||||
// Stage 高度变化时补偿视图中心,避免底部面板折叠导致画布内容整体跳动。
|
||||
if (Math.abs(nextHeight - previousHeight) > 0.5) store.editor.viewY -= (nextHeight - previousHeight) / 2
|
||||
app.renderer.resize(Math.max(1, el.clientWidth), nextHeight)
|
||||
})
|
||||
stageResizeObserver.observe(el)
|
||||
createLayers()
|
||||
|
||||
Reference in new issue
Block a user