mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
a7a525c65e
49 changed files with 1519 additions and 539 deletions
|
|
@ -175,6 +175,11 @@ exports.getFrameOffsets = getFrameOffsets;
|
|||
/**
|
||||
* Get box quads adjusted for iframes and zoom level.
|
||||
*
|
||||
* Warning: this function returns things that look like DOMQuad objects but
|
||||
* aren't (they resemble an old version of the spec). Unlike the return value
|
||||
* of node.getBoxQuads, they have a .bounds property and not a .getBounds()
|
||||
* method.
|
||||
*
|
||||
* @param {DOMWindow} boundaryWindow
|
||||
* The window where to stop to iterate. If `null` is given, the top
|
||||
* window is used.
|
||||
|
|
@ -206,6 +211,7 @@ function getAdjustedQuads(boundaryWindow, node, region) {
|
|||
|
||||
let adjustedQuads = [];
|
||||
for (let quad of quads) {
|
||||
let bounds = quad.getBounds();
|
||||
adjustedQuads.push({
|
||||
p1: {
|
||||
w: quad.p1.w * scale,
|
||||
|
|
@ -232,14 +238,14 @@ function getAdjustedQuads(boundaryWindow, node, region) {
|
|||
z: quad.p4.z * scale
|
||||
},
|
||||
bounds: {
|
||||
bottom: quad.bounds.bottom * scale + yOffset,
|
||||
height: quad.bounds.height * scale,
|
||||
left: quad.bounds.left * scale + xOffset,
|
||||
right: quad.bounds.right * scale + xOffset,
|
||||
top: quad.bounds.top * scale + yOffset,
|
||||
width: quad.bounds.width * scale,
|
||||
x: quad.bounds.x * scale + xOffset,
|
||||
y: quad.bounds.y * scale + yOffset
|
||||
bottom: bounds.bottom * scale + yOffset,
|
||||
height: bounds.height * scale,
|
||||
left: bounds.left * scale + xOffset,
|
||||
right: bounds.right * scale + xOffset,
|
||||
top: bounds.top * scale + yOffset,
|
||||
width: bounds.width * scale,
|
||||
x: bounds.x * scale + xOffset,
|
||||
y: bounds.y * scale + yOffset
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue