Commit Graph
7 Commits
Author SHA1 Message Date
German Khokhlov 81fe7f88cc 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.
2026-11-19 03:07:04 +04:00
German Khokhlov 2e18673df8 fix(cctv): stand cameras and count markers on the drawn terrain
When the terrain height batch loses a chunk to the rate limit, the cameras
in it keep a sea-level fallback height. In the mountains that put them far
under the surface, so the view pass judged them by a point that was not
where they are drawn: a tilted view dropped the count marker, a click on
the marker framed empty ground, and icons drifted on tilt and pan.

- A camera with no real ground height takes the height of the terrain the
  globe draws once it is near the screen (up to 300 reads a pass, through
  the height service), and a later answer from the batch replaces it.
- A count marker is anchored to the drawn terrain under its centre, and a
  click frames that ground.
- Cameras on one mount draw side by side, 30 px apart, each with its own
  callout, instead of as one icon with several callouts.

The photoreal map stack is not covered: terrain is not the surface there.
2026-11-19 00:03:34 +04:00
German Khokhlov 65942008bf 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.
2026-11-18 21:23:41 +04:00
German Khokhlov c536d22ff0 feat(cctv): green count markers that grow with the count and carry a camera icon
A count marker now says what it counts and how much:

- Its height grows with the count, from 40 px for two cameras to 58 px for
  several thousand, with clear fill around the digits.
- A small single-camera map icon sits under the top of the ring and the
  number just below the centre, so the two never touch. The icon is built
  from the same sprite as a single camera on the map.
- Thousands print as 1.7K or 12K in every UI language.
- The camera layer is green: count markers and idle single cameras share
  the colour, the active camera stays gold and live-video cameras violet.
2026-11-18 20:48:33 +04:00
German Khokhlov aabfa5e084 fix(cctv): paint count markers on the world overlay canvas
The scene renders at CSS resolution and is stretched on a high-density
display, so a count marker drawn as a scene sprite looked coarse next
to the camera callouts, which the world overlay paints at device
density.

Paint the markers through the overlay's custom paint lane instead, in
the callouts' typeface. Each paint reprojects the group centres; a
click is resolved against the rectangles painted in the last frame and
still zooms to the group without choosing a camera. A marker that would
cover HUD chrome is skipped, as overlay entries are.

With no aggregate sprites left, the contact sweep no longer needs to
skip them, so that exclusion is removed.
2026-11-18 15:31:20 +04:00
German Khokhlov 87bff9957b fix(cctv): draw the count marker's ring cleanly
The ring was three texture pixels wide and touched the sprite edge, so
at screen size it came out one jagged pixel wide with a clipped top and
bottom, and the sharpen pass pushed it towards white with an orange
fringe over bright ground.

Draw it two screen pixels wide, inset from the sprite edge so its outer
edge antialiases, with a dark rim outside it. Labels of up to three
digits always stay in a circle; longer ones get a pill with room for
its rounded ends.
2026-11-18 15:02:07 +04:00
German Khokhlov 607796737c feat(cctv): show how many cameras a thinned marker stands for
Zoomed out, the layer keeps one camera per ground cell and drew it as an
ordinary icon, so nothing showed that dozens or hundreds of other cameras
sat behind it. A cell with two or more cameras is now one round marker
with the count inside, at the centre of its cameras. Single cameras and
the active camera keep their icons.

The count covers the whole cell, so it does not change while the cell
crosses the screen edge. Markers that would overlap on screen merge into
one carrying their sum. Counts above 999 use the compact form of the UI
language and widen the marker into a pill. Clicking a marker zooms to
its group and does not choose a camera.

Ambient cards and coverage attach only to cameras drawn as icons; the
camera picker keeps one representative per visible cell as before.
2026-11-18 14:26:37 +04:00