Label constellations with zodiac symbols instead of names
♈–♓ glyphs (text presentation forced via U+FE0E), slightly larger and brighter than the old name labels; collision avoidance unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015HtPHsTnDcLVSCiF5FGHZj
This commit is contained in:
parent
e31a675ebe
commit
0d0b6d5df4
1 changed files with 14 additions and 7 deletions
|
|
@ -1536,6 +1536,11 @@ function makeConstellationPreviewProjector(constellation, W, horizonPx) {
|
|||
};
|
||||
}
|
||||
|
||||
const ZODIAC_SYMBOLS = {
|
||||
Ari: '♈', Tau: '♉', Gem: '♊', Cnc: '♋', Leo: '♌', Vir: '♍',
|
||||
Lib: '♎', Sco: '♏', Sgr: '♐', Cap: '♑', Aqr: '♒', Psc: '♓',
|
||||
};
|
||||
|
||||
/* Traçados convencionais dos 12 signos zodiacais, ancorados em RA/Dec J2000. */
|
||||
function drawConstellations(c, lst, W, H, horizonPx) {
|
||||
if (!showConstellations || typeof CONSTELLATIONS === 'undefined') return;
|
||||
|
|
@ -1601,24 +1606,26 @@ function drawConstellations(c, lst, W, H, horizonPx) {
|
|||
}
|
||||
}
|
||||
|
||||
/* Todos os signos recebem nome; colisões na tela ainda são evitadas. */
|
||||
/* Cada signo é rotulado pelo seu símbolo; colisões na tela ainda são
|
||||
evitadas. \uFE0E força a forma de texto (sem versão emoji colorida). */
|
||||
c.shadowBlur = 5;
|
||||
c.font = `${Math.max(10, Math.round(H * 0.0105))}px ui-monospace, monospace`;
|
||||
c.font = `${Math.max(14, Math.round(H * 0.015))}px ui-monospace, monospace`;
|
||||
c.textAlign = 'center';
|
||||
c.textBaseline = 'middle';
|
||||
c.fillStyle = 'rgba(170,225,255,0.66)';
|
||||
c.fillStyle = 'rgba(170,225,255,0.72)';
|
||||
const occupied = [];
|
||||
for (const constellation of visible) {
|
||||
if (!constellation.label) continue;
|
||||
const sc = projectPoint(constellation.label);
|
||||
if (!sc || sc.y < 24 || sc.y > horizonPx - 18) continue;
|
||||
const width = c.measureText(constellation.name).width + 14;
|
||||
const box = { x1: sc.x - width / 2, y1: sc.y - 9,
|
||||
x2: sc.x + width / 2, y2: sc.y + 9 };
|
||||
const symbol = (ZODIAC_SYMBOLS[constellation.id] || constellation.name) + '\uFE0E';
|
||||
const width = c.measureText(symbol).width + 14;
|
||||
const box = { x1: sc.x - width / 2, y1: sc.y - 11,
|
||||
x2: sc.x + width / 2, y2: sc.y + 11 };
|
||||
if (occupied.some(o => box.x1 < o.x2 && box.x2 > o.x1 &&
|
||||
box.y1 < o.y2 && box.y2 > o.y1)) continue;
|
||||
occupied.push(box);
|
||||
c.fillText(preview ? `Prévia: ${constellation.name}` : constellation.name, sc.x, sc.y);
|
||||
c.fillText(symbol, sc.x, sc.y);
|
||||
}
|
||||
c.restore();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue