Merge pull request #18923 from timvandermeij/integration-test-text-layer
Fix the "Text selection using mouse doesn't jump when hovering on an empty area in a single page" integration test
This commit is contained in:
commit
17419de157
@ -39,17 +39,23 @@ describe("Text layer", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function middlePosition(rect) {
|
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) {
|
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) {
|
function belowEndPosition(rect) {
|
||||||
return {
|
return {
|
||||||
x: rect.x + rect.width,
|
x: Math.round(rect.x + rect.width),
|
||||||
y: rect.y + Math.floor(rect.height * 1.5),
|
y: Math.round(rect.y + rect.height * 1.5),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user