From 2955b12dd7b7ecc330fe7e136ec383f808ba9348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 14 Feb 2013 20:00:47 -0800 Subject: [PATCH] Always read canvas attributes to determine view size. Closes #96. --- src/ui/View.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ui/View.js b/src/ui/View.js index a6b8bc8c..084ff696 100644 --- a/src/ui/View.js +++ b/src/ui/View.js @@ -58,12 +58,10 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{ DomEvent.add(window, this._windowHandlers); } else { // If the element is invisible, we cannot directly access - // element.width / height, because they would appear 0. Reading - // the attributes still works though: - size = DomElement.isInvisible(element) - ? Size.create(parseInt(element.getAttribute('width')), - parseInt(element.getAttribute('height'))) - : DomElement.getSize(element); + // element.width / height, because they would appear 0. + // Reading the attributes always works though. + size = Size.create(parseInt(element.getAttribute('width'), 10), + parseInt(element.getAttribute('height'), 10)); } // 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