From bdde7151a201d19750509dcac89d744cc8695363 Mon Sep 17 00:00:00 2001 From: Andrea Bogazzi Date: Sun, 21 Sep 2014 23:41:07 +0200 Subject: [PATCH] Update canvas.class.js fix for ie8 missing width and height in bounds --- src/canvas.class.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/canvas.class.js b/src/canvas.class.js index e6fef510..351a5adf 100644 --- a/src/canvas.class.js +++ b/src/canvas.class.js @@ -831,6 +831,21 @@ bounds = upperCanvasEl.getBoundingClientRect(), cssScale; + if (!bounds.width || !bounds.height) { + if ('top' in bounds && 'bottom' in bounds) { + bounds.height = bounds.top - bounds.bottom; + } + else { + bounds.height = 0; + } + if ('right' in bounds && 'left' in bounds) { + bounds.width = bounds.right - bounds.left; + } + else { + bounds.width = 0; + } + } + this.calcOffset(); pointer.x = pointer.x - this._offset.left;