File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 1+ let appWidth , appHeight ; //variable to maintain the size of the app
12function 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
69function draw ( )
@@ -13,5 +16,7 @@ function draw()
1316}
1417function windowResized ( )
1518{
16- resizeCanvas ( windowWidth , windowHeight ) ;
19+ appWidth = ( windowWidth < 1280 ) ?1280 :windowWidth ;
20+ appHeight = ( windowHeight < 720 ) ?720 :windowHeight ;
21+ resizeCanvas ( appWidth , appHeight ) ;
1722}
You can’t perform that action at this time.
0 commit comments