From 5a0ac3a5320b293dbdeac284e103bb8c6878cf7b Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 15 Dec 2019 16:41:38 +0100 Subject: [PATCH] Warm Up at the begining --- Spaces/FloatingSpace.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Spaces/FloatingSpace.js b/Spaces/FloatingSpace.js index b5dbad099..b82fde99e 100644 --- a/Spaces/FloatingSpace.js +++ b/Spaces/FloatingSpace.js @@ -41,6 +41,7 @@ function newFloatingSpace () { let devicePixelRatio = window.devicePixelRatio const SPACE_SIZE = 50000 + const WARM_UP_LIMIT = 10000 thisObject.container.frame.width = SPACE_SIZE thisObject.container.frame.height = SPACE_SIZE @@ -100,7 +101,7 @@ function newFloatingSpace () { After that we will start evaluating which ones are too far from the current user view. */ - if (warmingUpCounter < 10000) { + if (warmingUpCounter < WARM_UP_LIMIT) { warmingUpCounter++ return false } @@ -271,7 +272,7 @@ function newFloatingSpace () { } function physics () { - if (visible === true) { + if (visible === true || warmingUpCounter < WARM_UP_LIMIT) { browserZoomPhysics() thisObject.floatingLayer.physics() }