We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66a9c48 commit fdedeb2Copy full SHA for fdedeb2
p5js/js/electron/resizer.js
@@ -7,7 +7,10 @@ const observer = new MutationObserver((mutationList) => {
7
mutation => mutation.addedNodes[0]?.nodeName === "MAIN"
8
).length > 0;
9
if (p5Ready) {
10
- const { width, height } = document.querySelector("canvas");
+ // Choose CSS over device pixels for proper window size across all screens
11
+ const { style } = document.querySelector("canvas");
12
+ const width = parseInt(style.width);
13
+ const height = parseInt(style.height);
14
pde.resize({
15
width,
16
height
0 commit comments