From e65177f2f0b9c0758d25f073cee91efe0b15b26a Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sat, 1 Feb 2020 12:01:37 +0100 Subject: [PATCH] Always make canvas just bigger than window size --- voicegardens/static/voicegardens.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/voicegardens/static/voicegardens.js b/voicegardens/static/voicegardens.js index 27645f5..4e44369 100644 --- a/voicegardens/static/voicegardens.js +++ b/voicegardens/static/voicegardens.js @@ -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); }