Skip to content

Commit

Permalink
res
Browse files Browse the repository at this point in the history
  • Loading branch information
turtledreams committed Dec 9, 2024
1 parent 3e4f8e3 commit f8968cd
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions modules/CountlyClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -3728,10 +3728,14 @@ constructor(ob) {
iframe.id = this.#contentIframeID;
iframe.src = response.html;
iframe.style.position = "absolute";
iframe.style.left = response.geo.l.x + "px";
iframe.style.top = response.geo.l.y + "px";
iframe.style.width = response.geo.l.w + "px";
iframe.style.height = response.geo.l.h + "px";
var dimensionToUse = response.geo.p;
if (screen && screen.orientation.angle === 90) {
dimensionToUse = response.geo.l;
};
iframe.style.left = dimensionToUse.x + "px";
iframe.style.top = dimensionToUse.y + "px";
iframe.style.width = dimensionToUse.w + "px";
iframe.style.height = dimensionToUse.h + "px";
iframe.style.border = "none";
iframe.style.zIndex = "999999";
document.body.appendChild(iframe);
Expand Down Expand Up @@ -4274,18 +4278,16 @@ constructor(ob) {
}
var iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
if (iOS && window.devicePixelRatio) {
this.#log(logLevelEnums.VERBOSE, "Mobile Mac device detected, adjusting resolution");
// ios provides dips, need to multiply
width = Math.round(width * window.devicePixelRatio);
height = Math.round(height * window.devicePixelRatio);
}
else {
if (Math.abs(screen.orientation.angle) === 90) {
// we have landscape orientation
// switch values for all except ios
var temp = width;
width = height;
height = temp;
}
if (Math.abs(screen.orientation.angle) === 90) {
this.#log(logLevelEnums.VERBOSE, "Screen is in landscape mode, adjusting resolution");
var temp = width;
width = height;
height = temp;
}
return { width: width, height: height , orientation: screen.orientation.angle };
};
Expand Down

0 comments on commit f8968cd

Please sign in to comment.