mirror of
https://github.com/zen-browser/desktop.git
synced 2026-08-27 00:41:31 +00:00
no-bug: Sync upstream Firefox to version 150.0.2 (gh-13601)
This commit is contained in:
@@ -313,16 +313,18 @@ class nsZenGlanceManager extends nsZenDOMOperatedFeature {
|
||||
// content process since it does not take into account scroll. This way, we can
|
||||
// be sure that the coordinates are correct.
|
||||
const tabPanelsRect = gBrowser.tabpanels.getBoundingClientRect();
|
||||
const zoomLevel =
|
||||
this.#currentParentTab?.linkedBrowser.browsingContext.fullZoom || 1;
|
||||
const rect = new DOMRect(
|
||||
data.clientX + tabPanelsRect.left,
|
||||
data.clientY + tabPanelsRect.top,
|
||||
data.width,
|
||||
data.height
|
||||
data.clientX / zoomLevel + tabPanelsRect.left,
|
||||
data.clientY / zoomLevel + tabPanelsRect.top,
|
||||
data.width / zoomLevel,
|
||||
data.height / zoomLevel
|
||||
);
|
||||
return await this.#imageBitmapToObjectURL(
|
||||
await window.browsingContext.currentWindowGlobal.drawSnapshot(
|
||||
rect,
|
||||
1,
|
||||
zoomLevel,
|
||||
"transparent",
|
||||
undefined
|
||||
)
|
||||
|
||||
@@ -66,11 +66,13 @@ export class ZenGlanceChild extends JSWindowActorChild {
|
||||
) {
|
||||
rect = originalTargetRect;
|
||||
}
|
||||
// Change the rect to make sure we take into account zoom.
|
||||
const zoom = this.browsingContext.fullZoom;
|
||||
this.sendAsyncMessage("ZenGlance:RecordLinkClickData", {
|
||||
clientX: rect.left,
|
||||
clientY: rect.top,
|
||||
width: rect.width,
|
||||
height: rect.height,
|
||||
clientX: rect.left * zoom,
|
||||
clientY: rect.top * zoom,
|
||||
width: rect.width * zoom,
|
||||
height: rect.height * zoom,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user