From 16b3ef77d15179076144d45c9edfdb6d37beb41e Mon Sep 17 00:00:00 2001 From: samhed Date: Wed, 11 Mar 2015 07:29:30 +0100 Subject: [PATCH] Make getCanvasLimit more efficient by only calling getPosition once. --- include/ui.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/ui.js b/include/ui.js index bcc0a948..25f8617c 100644 --- a/include/ui.js +++ b/include/ui.js @@ -255,8 +255,9 @@ var UI; // Hide the scrollbars until the size is calculated container.style.overflow = "hidden"; - var w = Util.getPosition(container).width; - var h = Util.getPosition(container).height; + var pos = Util.getPosition(container); + var w = pos.width; + var h = pos.height; container.style.overflow = "visible";