fix filtering of table on the right when V is disabled

This commit is contained in:
Matthias Wirth
2020-12-07 07:48:35 +01:00
parent 33141320da
commit bb9fff040c

View File

@@ -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");