Update canvas.class.js

fix for ie8 missing width and height in bounds
This commit is contained in:
Andrea Bogazzi 2014-09-21 23:41:07 +02:00
parent c6091b6be2
commit bdde7151a2

View file

@ -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;