Skip to content

Commit 035ac78

Browse files
committed
fix(tile-util): use rect top instead of y and add scrolLelft to calculations
1 parent c198366 commit 035ac78

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/tile-manager/tile-util.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ class TileResizeState {
329329
const offsetY = this.getGridOffset(grid, 'vertical');
330330

331331
this._position.row.start = this.calculatePosition(
332-
tileRect.y + window.scrollY - offsetY,
332+
tileRect.top + window.scrollY - offsetY,
333333
this._rows.entries
334334
);
335335
}
@@ -372,7 +372,10 @@ class TileResizeState {
372372
const computed = getComputedStyle(grid);
373373

374374
return axis === 'horizontal'
375-
? gridRect.left + window.scrollX + Number.parseFloat(computed.paddingLeft)
375+
? gridRect.left +
376+
window.scrollX +
377+
grid.scrollLeft +
378+
Number.parseFloat(computed.paddingLeft)
376379
: gridRect.top + window.scrollY + Number.parseFloat(computed.paddingTop);
377380
}
378381
}

0 commit comments

Comments
 (0)