Skip to content

Commit

Permalink
Update globals.js
Browse files Browse the repository at this point in the history
jelveh committed Jan 27, 2025
1 parent bb348e4 commit 52c1adb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/gui/src/globals.js
Original file line number Diff line number Diff line change
@@ -175,6 +175,9 @@ $( window ).on( "resize", function() {
const new_desktop_width = window.innerWidth;

$('.window').each((_, el) => {
// if window is maximized, do not resize
if($(el).attr('data-is_maximized') === "1") return;

// if data-is_fullpage="1" then the window is in fullpage mode
// and should not be resized
if($(el).attr('data-is_fullpage') === "1") return;
@@ -189,11 +192,11 @@ $( window ).on( "resize", function() {
}
}

const leftRadio = pos.left / window.desktop_width;
const topRadio = pos.top / window.desktop_height;
const leftRatio = pos.left / window.desktop_width;
const topRatio = pos.top / window.desktop_height;

let left = new_desktop_width * leftRadio;
let top = new_desktop_height * topRadio;
let left = new_desktop_width * leftRatio;
let top = new_desktop_height * topRatio;

const maxLeft = new_desktop_width - $(el).width();
const maxTop = new_desktop_height - $(el).height();

0 comments on commit 52c1adb

Please sign in to comment.