mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 18:22:25 +00:00
fix(cctv): keep a clicked group in frame and let counts take clicks over plain fills
- The flight after a count click checks the frame on both axes and at the height of the highest mount, so a group on a slope or in a very wide window stays in view; when it cannot, it flies to the nearest cell with two or more cameras, never to a lone camera that joined the count. - A count takes a click over a background fill no layer owns (earthquake discs, fire perimeters), and still yields to a scene item another layer registered. - A count crossing the HUD edge refreshes the view only when the active icon or a lone camera depends on it, and never mid-motion, so panning no longer runs extra full view passes. - A count restored at the HUD edge keeps the lone cameras its outline covers, and leaves the others as icons.
This commit is contained in:
1 parent
f6982dc934
commit
aba4c9e533
14 files changed
+674
-41
No files matched your search
@@ -154,7 +154,7 @@ export function createRendering({
|
||||
layerState._counts = createCountMarkers(
|
||||
services.overlays?.registerWorldOverlayPaintLane,
|
||||
`cctv:${iconSets}:counts`,
|
||||
refreshHorizonCulling,
|
||||
refreshViewFromCounts,
|
||||
services.overlays?.keyholeAlpha,
|
||||
);
|
||||
return set.id;
|
||||
@@ -356,6 +356,11 @@ export function createRendering({
|
||||
return { writes, transitioning, activeCount, ran: true };
|
||||
}
|
||||
|
||||
/** During camera motion the timer and settle pass refresh the counts. */
|
||||
function refreshViewFromCounts() {
|
||||
if (!layerState._cameraMoving) refreshHorizonCulling();
|
||||
}
|
||||
|
||||
/**
|
||||
* Cull far-side cameras on the CPU because the hidden globe writes no depth.
|
||||
* Group the rest by ground cell. _viewRecords holds the active camera and
|
||||
@@ -691,9 +696,10 @@ export function createRendering({
|
||||
|
||||
/** Only counts visible outside the HUD push the active icon aside. */
|
||||
function clearActiveOfCounts(project, pose, metresPerPixelPerMetre, pass) {
|
||||
const markers = layerState._counts?.markers;
|
||||
for (const marker of markers ?? []) marker.besideActive = false;
|
||||
if (!layerState._activeCameraId) return;
|
||||
const record = layerState._recordById.get(layerState._activeCameraId);
|
||||
const markers = layerState._counts?.markers;
|
||||
if (
|
||||
record?.viewPass !== pass ||
|
||||
!markers?.length ||
|
||||
@@ -710,13 +716,14 @@ export function createRendering({
|
||||
(CAMERA_ICON_PX * 1.25 * iconScaleAt(distance(p, pose.position))) / 2;
|
||||
const spans = [];
|
||||
for (const marker of markers) {
|
||||
if (marker.hudHidden) continue;
|
||||
const at = project(marker.pos);
|
||||
if (
|
||||
!at ||
|
||||
Math.abs(y - at.y) >= marker.height / 2 + half + COUNT_MERGE_GAP_PX
|
||||
)
|
||||
continue;
|
||||
marker.besideActive = true;
|
||||
if (marker.hudHidden) continue;
|
||||
const reach = marker.width / 2 + half + COUNT_MERGE_GAP_PX;
|
||||
spans.push([at.x - reach, at.x + reach]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user