fix(daymark): lados paralelos + tamaño menor en enfilacion

- sz 48→34 (símbolo más pequeño en mapa)
- Triángulo interior escalado desde el baricentro → lados
  estrictamente paralelos al exterior (triángulo similar, no
  recortado con offset independiente)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-30 18:35:07 -04:00
parent aa1b93c7a8
commit 00f1eb92d8
+18 -18
View File
@@ -1216,10 +1216,10 @@ function _encBeaconCanvas(colours, catlam, region, sz = 44) {
} }
// ── Range / Leading-mark dayboard — dos triángulos concéntricos ────────────── // ── Range / Leading-mark dayboard — dos triángulos concéntricos ──────────────
// Símbolo estándar IALA: triángulo exterior BLANCO + triángulo interior NEGRO. // Símbolo IALA: triángulo exterior BLANCO + interior NEGRO con lados
// Ambos apuntan hacia arriba. Sin patas, sin mástil — solo la marca diurna. // estrictamente paralelos (triángulo similar centrado en el baricentro).
// Flare de luz en el ápice si la feature tiene LITCHR. // Tamaño reducido para no dominar el mapa.
function _encRangeDaymarkCanvas(colours, hasLight, sz = 48) { function _encRangeDaymarkCanvas(colours, hasLight, sz = 34) {
const c = _mkC(sz); const ctx = c.getContext('2d'); const cx = sz / 2; const c = _mkC(sz); const ctx = c.getContext('2d'); const cx = sz / 2;
// Light colour for optional flare // Light colour for optional flare
@@ -1227,7 +1227,7 @@ function _encRangeDaymarkCanvas(colours, hasLight, sz = 48) {
// ── Layout ─────────────────────────────────────────────────────────────── // ── Layout ───────────────────────────────────────────────────────────────
const triTop = sz * 0.06; // apex of outer triangle const triTop = sz * 0.06; // apex of outer triangle
const triBot = sz * 0.92; // base of outer triangle const triBot = sz * 0.94; // base of outer triangle
const halfW = sz * 0.44; // half-width at base const halfW = sz * 0.44; // half-width at base
// ── OUTER triangle — WHITE ─────────────────────────────────────────────── // ── OUTER triangle — WHITE ───────────────────────────────────────────────
@@ -1238,29 +1238,29 @@ function _encRangeDaymarkCanvas(colours, hasLight, sz = 48) {
ctx.closePath(); ctx.closePath();
ctx.fillStyle = '#ffffff'; ctx.fillStyle = '#ffffff';
ctx.fill(); ctx.fill();
// thin dark border so it reads against light backgrounds ctx.strokeStyle = '#555';
ctx.strokeStyle = '#444';
ctx.lineWidth = 1.0; ctx.lineWidth = 1.0;
ctx.stroke(); ctx.stroke();
// ── INNER triangle — BLACK (45 % of outer) ─────────────────────────────── // ── INNER triangle — BLACK, lados paralelos al exterior ──────────────────
const iS = 0.45; // Escalar desde el baricentro garantiza lados paralelos (triángulo similar).
const triH = triBot - triTop; const r = 0.48; // escala del interior
const iTop = triTop + triH * (1 - iS) * 0.50; const cy = (triTop + 2 * triBot) / 3; // baricentro Y del triángulo exterior
const iBot = triBot - triH * (1 - iS) * 0.15; const iApexY = cy + r * (triTop - cy); // vértice superior del interior
const iHalf = halfW * iS * ((iBot - triTop) / triH); const iBaseY = cy + r * (triBot - cy); // base del interior
const iHalf = halfW * r; // media-anchura → lados paralelos
ctx.beginPath(); ctx.beginPath();
ctx.moveTo(cx, iTop); ctx.moveTo(cx, iApexY);
ctx.lineTo(cx + iHalf, iBot); ctx.lineTo(cx + iHalf, iBaseY);
ctx.lineTo(cx - iHalf, iBot); ctx.lineTo(cx - iHalf, iBaseY);
ctx.closePath(); ctx.closePath();
ctx.fillStyle = '#111111'; ctx.fillStyle = '#111111';
ctx.fill(); ctx.fill();
ctx.strokeStyle = '#000'; ctx.strokeStyle = '#000';
ctx.lineWidth = 0.5; ctx.lineWidth = 0.6;
ctx.stroke(); ctx.stroke();
// ── Light flare at apex ─────────────────────────────────────────────────── // ── Light flare al ápice (si la feature tiene luz) ───────────────────────
if (hasLight) { if (hasLight) {
_drawLightFlare(ctx, cx, triTop - sz * 0.02, lightCss); _drawLightFlare(ctx, cx, triTop - sz * 0.02, lightCss);
} }