From e1fea0cc3fefedb381614e9856f80b9392957587 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 27 Nov 2019 10:47:23 +0100 Subject: [PATCH] Bug fixed when calculated which objects are too far to be drawn --- Spaces/FloatingSpace.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Spaces/FloatingSpace.js b/Spaces/FloatingSpace.js index 4b0679567..ab007e6d1 100644 --- a/Spaces/FloatingSpace.js +++ b/Spaces/FloatingSpace.js @@ -76,7 +76,7 @@ function newFloatingSpace () { thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel) } - function isItFar (payload) { + function isItFar (payload, dontCheckParent) { /* We need a warm up in order to allow all objects to stabilize into a consistant state. After that we will start evaluating which ones are too far from the current user view. @@ -87,7 +87,14 @@ function newFloatingSpace () { return false } - let radarFactor = 4 // How big is the margin + let radarFactor = 2 // How big is the margin + + /* If the chain parent is not far, they we dont consither this far. */ + if (dontCheckParent !== true) { + if (payload.chainParent !== undefined) { + if (isItFar(payload.chainParent.payload, true) === false) { return false } + } + } /* Exceptions that are never considered far. */ if (