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:
German Khokhlov committed 2026-11-20 02:02:06 +04:00
1 parent f6982dc934
commit aba4c9e533
14 files changed
+674 -41

No files matched your search

+12 -2
View File
@@ -11,7 +11,12 @@ export function createSelection({
source,
}) {
const { CCTV_ACTIVATION_RESULT } = services.activation;
const { resolvePickId, findPickOwner, isUnderOtherCard } = services.picking;
const {
resolvePickId,
findPickOwner,
isOwnedByOtherLayer,
isUnderOtherCard,
} = services.picking;
const OWN_CARD_SOURCES = [CCTV_OVERLAY_SOURCE_ID, CCTV_COUNT_CARD_SOURCE_ID];
/**
@@ -39,7 +44,12 @@ export function createSelection({
const top = event.topHit;
if (!top) return false;
const drawHit = event.drawHit;
if (drawHit) return !parts.rendering.extractPickedCameraId(drawHit);
if (drawHit) {
// Unowned fills, such as earthquake discs, let the count take the click.
if (parts.rendering.extractPickedCameraId(drawHit)) return false;
const id = resolvePickId(drawHit);
return id !== null && Boolean(isOwnedByOtherLayer?.('cctv', id));
}
const id = resolvePickId(top);
return id !== null && findPickOwner?.(id) !== 'cctv';
}