fix: inaccurate mouse position (#522)

1. Position of mouse was inaccurate when replaying and this PR will fix it.
2. Fix the bug that if one nested iframe has a scale transform and the position of mouse was inaccurate as well.
This commit is contained in:
Lucky Feng
2026-04-01 12:00:00 +08:00
committed by GitHub
parent e9d915b3d6
commit 66c7c8f028
5 changed files with 28 additions and 9 deletions

View File

@@ -1422,9 +1422,9 @@ export class Replayer {
return this.debugNodeNotFound(d, id);
}
const base = getBaseDimension(target);
const _x = x + base.x;
const _y = y + base.y;
const base = getBaseDimension(target, this.iframe);
const _x = x * base.absoluteScale + base.x;
const _y = y * base.absoluteScale + base.y;
this.mouse.style.left = `${_x}px`;
this.mouse.style.top = `${_y}px`;