Always make canvas just bigger than window size

This commit is contained in:
Luke Murphy 2020-02-01 12:01:37 +01:00
parent 32335c5305
commit e65177f2f0
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -6,8 +6,8 @@
var archiveUrl = window.location + "add-to-archive";
var canvas;
var canvasHeight;
var canvasWidth;
var canvasHeight = 500;
var canvasWidth = 500;
var centerX;
var centerY;
var frameRate = 30;
@ -304,8 +304,8 @@ function setup() {
/**
* The p5.js initial setup function.
**/
canvasWidth = windowWidth;
canvasHeight = windowHeight;
canvasWidth += windowWidth;
canvasHeight += windowHeight;
createCanvas(canvasWidth, canvasHeight);
frameRate(frameRate);
@ -375,5 +375,7 @@ function windowResized() {
/**
* Canvas re-draw handling.
**/
resizeCanvas(windowWidth, windowHeight);
canvasWidth += windowWidth;
canvasHeight += windowHeight;
resizeCanvas(canvasWidth, canvasHeight);
}