Skip to content

Commit

Permalink
overlay height and width settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ari-party committed Nov 20, 2024
1 parent d6b8eb4 commit 476d1ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions packages/mtc-artillery/src/views/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,21 @@ export default function OverlayView() {
);
const appWindow = getCurrentWebviewWindow();

const height = Math.min(
document.body.scrollHeight,
document.body.offsetHeight,
);
const boundingClientRect =
document.documentElement.getBoundingClientRect();

await appWindow.setSize(new LogicalSize(windowWidth, height));
await appWindow.setSize(
new LogicalSize(windowWidth, boundingClientRect.height),
);
} catch (error) {
console.error(error);
}
}

updateSize();

window.addEventListener('resize', updateSize);
return () => window.removeEventListener('resize', updateSize);
}, []);

return (
Expand Down
4 changes: 2 additions & 2 deletions packages/overlay/src/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"alwaysOnTop": true,
"decorations": false,
"dragDropEnabled": false,
"height": 1000,
"height": 600,
"label": "main",
"maximizable": false,
"minimizable": false,
Expand All @@ -36,7 +36,7 @@
"title": "Artillery overlay",
"shadow": false,
"transparent": true,
"width": 500,
"width": 350,
"useHttpsScheme": true
}
],
Expand Down

0 comments on commit 476d1ff

Please sign in to comment.