mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
Keep an application's Cockpit subject steady in the camera and HUD
- A height the entry frame gave holds while later frames give none and the floor is still cold, so the view no longer waits and ends. - A subject's camera update advances by the time since the last one, up to its interval plus a second: at 5 frames a second an inertial subject no longer falls behind (700 m in a minute at 30 m/s), while a hidden tab still counts as one late update. - A provider's Live Signals rows change where they stand and come back after newer rows pushed them off, so a changing ETA no longer hides a steady warning; the built-in rows log as before. - Progress labels give full-width glyphs (CJK, kana, Hangul) about 1 em, so such stop names no longer overlap. - A provider's labels, entry face and look start from the words checked at registration, so one that fails on its next read keeps them. The double-click test on a selected vessel now projects through SceneTransforms, as the scene query port does, with a control that enters the bridge.
This commit is contained in:
1 parent
624c229bc2
commit
a2a61c506f
12 files changed
+329
-58
No files matched your search
+22
-6
@@ -30,13 +30,29 @@ const TONE_RANK = Object.freeze([
|
||||
const stronger = (a, b) =>
|
||||
TONE_RANK.indexOf(b) > TONE_RANK.indexOf(a) ? b : a;
|
||||
|
||||
/** A label's width estimate (px): its longer line in small capitals. */
|
||||
/**
|
||||
* Full-width glyphs (CJK ideographs and punctuation, kana, Hangul, full-width
|
||||
* forms), each about 1 em wide.
|
||||
*/
|
||||
const WIDE_GLYPH =
|
||||
/[ᄀ-ᅟ⺀-〾ぁ-㏿㐀-䶿一-鿿ꥠ-가-힣豈-︰-﹏-⦆¢-₩\u{20000}-\u{3fffd}]/u;
|
||||
|
||||
/** One line's width in the label's 10 px type, 0.06 em apart (px). */
|
||||
function lineWidthPx(line) {
|
||||
let wide = 0;
|
||||
let narrow = 0;
|
||||
for (const glyph of String(line ?? ''))
|
||||
if (WIDE_GLYPH.test(glyph)) wide += 1;
|
||||
else narrow += 1;
|
||||
return wide * 10.6 + narrow * 6.4;
|
||||
}
|
||||
|
||||
/**
|
||||
* A label's width estimate (px): its longer line, a full-width glyph at
|
||||
* 10.6 px and any other at 6.4 px.
|
||||
*/
|
||||
export function estimateProgressLabelPx(label) {
|
||||
const longest = Math.max(
|
||||
String(label?.text ?? '').length,
|
||||
String(label?.detail ?? '').length,
|
||||
);
|
||||
return longest * 6.4 + 8;
|
||||
return Math.max(lineWidthPx(label?.text), lineWidthPx(label?.detail)) + 8;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user