From ae1b59b2c14a86ab9a777cac68e0b4e6caceaff3 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 24 Mar 2020 15:32:56 +0100 Subject: [PATCH] Fix canvas initial size --- www/whiteboard/inner.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/www/whiteboard/inner.js b/www/whiteboard/inner.js index e45cc35f0..2c3125903 100644 --- a/www/whiteboard/inner.js +++ b/www/whiteboard/inner.js @@ -284,15 +284,14 @@ define([ }); var $canvas = $('canvas'); var $canvasContainer = $('canvas').parents('.cp-app-whiteboard-canvas-container'); + var $container = $('#cp-app-whiteboard-container'); // Max for old macs: 2048×1464 // Max for IE: 8192x8192 var MAX = 8192; var onResize = APP.onResize = function () { - $canvasContainer.css('width', ''); - $canvasContainer.css('height', ''); - var w = $canvasContainer.width() - 20; - var h = $canvasContainer.height(); + var w = $container.width(); + var h = $container.height(); canvas.forEachObject(function (obj) { var c = obj.getCoords(); Object.keys(c).forEach(function (k) {