Skip to content

Commit 0cb9bbb

Browse files
committed
resolving conflict
2 parents a2e726d + 5b3e427 commit 0cb9bbb

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
padding: 0;
1111
margin: 0;
1212
}
13+
14+
canvas {
15+
position: absolute;
16+
}
1317
</style>
1418
<script src="p5.js"></script>
1519
<script src="p5.sound.js"></script>

main.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
let appWidth,appHeight; //variable to maintain the size of the app
12
function setup()
23
{
3-
createCanvas(windowWidth,windowHeight);
4+
appWidth=(windowWidth<1280)?1280:windowWidth; //minimum width of the app should be 1280 pixels and max should be the windowWidth
5+
appHeight=(windowHeight<720)?720:windowHeight; //minimum height of the app should be 720 pixels and max should be the windowHeight
6+
createCanvas(appWidth,appHeight);
47
}
58

69
function draw()
@@ -13,5 +16,7 @@ function draw()
1316
}
1417
function windowResized()
1518
{
16-
resizeCanvas(windowWidth, windowHeight);
19+
appWidth=(windowWidth<1280)?1280:windowWidth;
20+
appHeight=(windowHeight<720)?720:windowHeight;
21+
resizeCanvas(appWidth, appHeight);
1722
}

0 commit comments

Comments
 (0)