Skip to content

Commit

Permalink
Revert "chore(bidi): use fractional coordinates for pointerAction (#3… (
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-s authored Feb 12, 2025
1 parent 8eb816b commit 703ca9f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/playwright-core/src/server/bidi/bidiInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ export class RawMouseImpl implements input.RawMouse {
}

async move(x: number, y: number, button: types.MouseButton | 'none', buttons: Set<types.MouseButton>, modifiers: Set<types.KeyboardModifier>, forClick: boolean): Promise<void> {
// Bidi throws when x/y are not integers.
x = Math.floor(x);
y = Math.floor(y);
await this._performActions([{ type: 'pointerMove', x, y }]);
}

Expand All @@ -91,6 +94,9 @@ export class RawMouseImpl implements input.RawMouse {
}

async wheel(x: number, y: number, buttons: Set<types.MouseButton>, modifiers: Set<types.KeyboardModifier>, deltaX: number, deltaY: number): Promise<void> {
// Bidi throws when x/y are not integers.
x = Math.floor(x);
y = Math.floor(y);
await this._session.send('input.performActions', {
context: this._session.sessionId,
actions: [
Expand Down

0 comments on commit 703ca9f

Please sign in to comment.