修复主屏容器在次页添加小组件会出现错位的bug

This commit is contained in:
luojiahao 2022-11-15 14:28:58 +08:00
parent 0f2ea87fe3
commit 1f00067af4
1 changed files with 3 additions and 3 deletions

View File

@ -247,10 +247,10 @@ export default class GaiaContainerChild {
const offsetTop = Math.abs(this.master.offsetTop)
const offsetLeft = Math.abs(
this.master.offsetLeft - this.pagination * this.manager.pageHeight
this.master.offsetLeft - (this.master.parentElement?.offsetLeft ?? 0)
)
const rowStart = Math.floor(offsetTop / this.manager.gridHeight) + 1
const columnStart = Math.floor(offsetLeft / this.manager.gridWidth) + 1
const rowStart = Math.round(offsetTop / this.manager.gridHeight) + 1
const columnStart = Math.round(offsetLeft / this.manager.gridWidth) + 1
return [rowStart, columnStart]
}