mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-15 09:13:11 +00:00
Update canvas.class.js
fix for ie8 missing width and height in bounds
This commit is contained in:
parent
c6091b6be2
commit
bdde7151a2
1 changed files with 15 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue