mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 18:22:25 +00:00
fix(cctv): count a lone camera in the marker it sits against
A ground cell with one camera always drew its icon, so at some zooms a camera poked out from under a count marker with its own callout. An icon closer than the merge gap to a count marker now joins that marker: the count grows by one and the icon, its callout and its card are not drawn. Two lone cameras with no count beside them stay two icons, and the active camera always keeps its own icon.
This commit is contained in:
1 parent
c536d22ff0
commit
65942008bf
8 files changed
+125
-24
No files matched your search
@@ -435,23 +435,26 @@ export function createRendering({
|
||||
cell.rank = rank;
|
||||
}
|
||||
}
|
||||
// Marks each lone camera that a count marker beside it has taken in.
|
||||
layerState._counts?.update(visibleCells, project);
|
||||
for (const cell of visibleCells) {
|
||||
const record = cell.winner;
|
||||
picker.push(record);
|
||||
record.pickerPass = pass;
|
||||
if (cell.count === 1) {
|
||||
if (cell.count === 1 && !cell.absorbed) {
|
||||
record.viewPass = pass;
|
||||
shown.push(record);
|
||||
}
|
||||
}
|
||||
layerState._counts?.update(visibleCells, project);
|
||||
const writes = [];
|
||||
let coverageChanged = false;
|
||||
let cardsChanged = false;
|
||||
for (const record of layerState._records) {
|
||||
const cell = record.viewCell;
|
||||
record.viewCell = null;
|
||||
const grouped = Boolean(cell?.winner && cell.count > 1);
|
||||
const grouped = Boolean(
|
||||
cell?.winner && (cell.count > 1 || cell.absorbed),
|
||||
);
|
||||
if (grouped !== !!record.viewGrouped) {
|
||||
const id = record.camera.id;
|
||||
coverageChanged ||= layerState._coverageCohort?.has(id);
|
||||
|
||||
Reference in new issue
Block a user