Skip to content

Commit

Permalink
Merge pull request #18923 from timvandermeij/integration-test-text-layer
Browse files Browse the repository at this point in the history
Fix the "Text selection using mouse doesn't jump when hovering on an empty area in a single page" integration test
  • Loading branch information
timvandermeij authored Oct 20, 2024
2 parents b94ab46 + 24b8393 commit 17419de
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/integration/text_layer_spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,23 @@ describe("Text layer", () => {
}

function middlePosition(rect) {
return { x: rect.x + rect.width / 2, y: rect.y + rect.height / 2 };
return {
x: Math.round(rect.x + rect.width / 2),
y: Math.round(rect.y + rect.height / 2),
};
}

function middleLeftPosition(rect) {
return { x: rect.x + 1, y: rect.y + Math.floor(rect.height / 2) };
return {
x: Math.round(rect.x + 1),
y: Math.round(rect.y + rect.height / 2),
};
}

function belowEndPosition(rect) {
return {
x: rect.x + rect.width,
y: rect.y + Math.floor(rect.height * 1.5),
x: Math.round(rect.x + rect.width),
y: Math.round(rect.y + rect.height * 1.5),
};
}

Expand Down

0 comments on commit 17419de

Please sign in to comment.