mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -05:00
parent
4cd069b1af
commit
2955b12dd7
1 changed files with 4 additions and 6 deletions
|
@ -58,12 +58,10 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{
|
||||||
DomEvent.add(window, this._windowHandlers);
|
DomEvent.add(window, this._windowHandlers);
|
||||||
} else {
|
} else {
|
||||||
// If the element is invisible, we cannot directly access
|
// If the element is invisible, we cannot directly access
|
||||||
// element.width / height, because they would appear 0. Reading
|
// element.width / height, because they would appear 0.
|
||||||
// the attributes still works though:
|
// Reading the attributes always works though.
|
||||||
size = DomElement.isInvisible(element)
|
size = Size.create(parseInt(element.getAttribute('width'), 10),
|
||||||
? Size.create(parseInt(element.getAttribute('width')),
|
parseInt(element.getAttribute('height'), 10));
|
||||||
parseInt(element.getAttribute('height')))
|
|
||||||
: DomElement.getSize(element);
|
|
||||||
}
|
}
|
||||||
// Set canvas size even if we just deterined the size from it, since
|
// Set canvas size even if we just deterined the size from it, since
|
||||||
// it might have been set to a % size, in which case it would use some
|
// it might have been set to a % size, in which case it would use some
|
||||||
|
|
Loading…
Reference in a new issue