mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 10:12:18 +00:00
fix(cctv): settle the review of the count markers
Bugs: - Cameras on one mount stay side by side after their geometry is built, so a click or a settled view no longer folds them back into one icon. - A count click yields to a card drawn over the marker and to another layer's object under it, waits while the cockpit or tracking holds the view, and flies at most halfway, so a long chain of cameras still splits. - The active camera's icon is never covered by a count, transparent corners of the marker no longer catch clicks, and a count hidden under the HUD keeps its lone cameras. - A lone camera joins only its nearest count and never bridges two; cameras close enough to draw as icons take part too, at their drawn icon size. - Groups across the antimeridian keep their longitude; the flight frames the highest mount; markers on ground below the ellipsoid stay visible; counts fade outside the Scope circle. - Mounts less than a metre apart count as one mount. - A drawn-terrain height survives a late fallback answer, is read for an unresolved camera and for one projected off the window, is re-read when the terrain under it finishes loading or the terrain source changes, and the read budget no longer goes to the same misses each pass. Cleanup: the glyph draws from one green SVG sprite instead of recolouring pixels, marker-only constants move next to their use, layout tests check behaviour rather than formulas, and docs and comments match the code. docs/I18N.md names the one fixed notation of count badges as an exception.
This commit is contained in:
1 parent
2e18673df8
commit
81fe7f88cc
26 files changed
+1608
-638
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { CCTV_OVERLAY_SOURCE_ID } from '../../data/cctvCards.js';
|
||||
import { isTrackingClickGesture } from '../../data/trackingClickGesture.js';
|
||||
|
||||
export function createSelection({
|
||||
@@ -7,7 +8,7 @@ export function createSelection({
|
||||
source,
|
||||
}) {
|
||||
const { CCTV_ACTIVATION_RESULT } = services.activation;
|
||||
const { resolvePickId } = services.picking;
|
||||
const { resolvePickId, findPickOwner } = services.picking;
|
||||
|
||||
/**
|
||||
* Returns the camera record for the currently active camera. A stale ID falls
|
||||
@@ -29,6 +30,23 @@ export function createSelection({
|
||||
return fallback;
|
||||
}
|
||||
|
||||
/** A card painted above the count, or another layer's object, owns the click. */
|
||||
function countYields(event) {
|
||||
const { x, y } = event.screenPosition;
|
||||
if (
|
||||
layerState._cctvOverlayHost?.hitTest(x, y, {
|
||||
sourceId: CCTV_OVERLAY_SOURCE_ID,
|
||||
})?.entryId
|
||||
)
|
||||
return true;
|
||||
const top = event.topHit;
|
||||
if (!top) return false;
|
||||
const drawHit = event.drawHit;
|
||||
if (drawHit) return !parts.rendering.extractPickedCameraId(drawHit);
|
||||
const id = resolvePickId(top);
|
||||
return id !== null && findPickOwner?.(id) !== 'cctv';
|
||||
}
|
||||
|
||||
/**
|
||||
* Bind CCTV activation to clean taps. Drag-like and long-press gestures do
|
||||
* not reach camera activation or focus dispatch.
|
||||
@@ -44,7 +62,7 @@ export function createSelection({
|
||||
const cell =
|
||||
layerState._enabled &&
|
||||
layerState._counts?.pickedCell(event.screenPosition);
|
||||
if (cell) {
|
||||
if (cell && !countYields(event)) {
|
||||
parts.navigation.zoomToCell(cell);
|
||||
return;
|
||||
}
|
||||
@@ -146,9 +164,9 @@ export function createSelection({
|
||||
// is looking at ever asks.
|
||||
void parts.ground.resolveFootprintGround(record);
|
||||
record.activationDone = true;
|
||||
// The active camera's icon always shows; the previously active one
|
||||
// competes for its cell again. Its coverage neighbours join the working
|
||||
// set and are queued for grounding.
|
||||
// The active icon always shows and the previous one rejoins its cell.
|
||||
// Restyle coverage after the view pass sets grouping. Its coverage
|
||||
// neighbours join the working set and are queued for grounding.
|
||||
parts.rendering.refreshHorizonCulling();
|
||||
parts.rendering.refreshCoverageStyles();
|
||||
parts.geometryQueue.enqueueViewGeometry();
|
||||
|
||||
Reference in new issue
Block a user