Fix canvas initial size

pull/1/head
yflory 5 years ago
parent 24e474e688
commit ae1b59b2c1

@ -284,15 +284,14 @@ define([
}); });
var $canvas = $('canvas'); var $canvas = $('canvas');
var $canvasContainer = $('canvas').parents('.cp-app-whiteboard-canvas-container'); var $canvasContainer = $('canvas').parents('.cp-app-whiteboard-canvas-container');
var $container = $('#cp-app-whiteboard-container');
// Max for old macs: 2048×1464 // Max for old macs: 2048×1464
// Max for IE: 8192x8192 // Max for IE: 8192x8192
var MAX = 8192; var MAX = 8192;
var onResize = APP.onResize = function () { var onResize = APP.onResize = function () {
$canvasContainer.css('width', ''); var w = $container.width();
$canvasContainer.css('height', ''); var h = $container.height();
var w = $canvasContainer.width() - 20;
var h = $canvasContainer.height();
canvas.forEachObject(function (obj) { canvas.forEachObject(function (obj) {
var c = obj.getCoords(); var c = obj.getCoords();
Object.keys(c).forEach(function (k) { Object.keys(c).forEach(function (k) {

Loading…
Cancel
Save