From bb9fff040cb7aaa4fade9af7bfe2c9d6993ac8b7 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Mon, 7 Dec 2020 07:48:35 +0100 Subject: [PATCH] fix filtering of table on the right when V is disabled --- html/script.js | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/html/script.js b/html/script.js index 3f0c8b7..b10c1a5 100644 --- a/html/script.js +++ b/html/script.js @@ -2546,21 +2546,18 @@ function refreshFeatures() { ctime && console.time("inView"); - let pList = PlanesOrdered; - if (tableInView) { - // only sort visible aircraft when only those are being put in the table (avoid 30 ms sorting for 7000 aircraft) - // well maybe i overestimated the time saved. .... maybe check some other time - pList = []; - for (let i = 0; i < PlanesOrdered.length; ++i) { - const plane = PlanesOrdered[i]; + let pList = []; + // only sort visible aircraft when only those are being put in the table (avoid 30 ms sorting for 7000 aircraft) + // well maybe i overestimated the time saved. .... still saves a couple of cpu cycles + for (let i = 0; i < PlanesOrdered.length; ++i) { + const plane = PlanesOrdered[i]; - plane.visible = !plane.isFiltered() && plane.checkVisible(); - plane.inView = plane.visible && inView(plane.position, lastRealExtent); + plane.visible = !plane.isFiltered() && plane.checkVisible(); + plane.inView = plane.visible && inView(plane.position, lastRealExtent); - plane.showInTable = false; - if (plane.inView) - pList.push(plane); - } + plane.showInTable = false; + if (plane.inView || !tableInView) + pList.push(plane); } ctime && console.timeEnd("inView");