diff --git a/src/components/game-distribution/GameLineagePage.tsx b/src/components/game-distribution/GameLineagePage.tsx index e835691d3..f836dd587 100644 --- a/src/components/game-distribution/GameLineagePage.tsx +++ b/src/components/game-distribution/GameLineagePage.tsx @@ -3,6 +3,7 @@ import './gameDistribution.css'; import { GameCard } from '@genarrative/shared/components'; import { ArrowLeft, Minimize, Minus, Plus, RefreshCcw } from 'lucide-react'; import { + type CSSProperties, type PointerEvent as ReactPointerEvent, useCallback, useEffect, @@ -41,6 +42,12 @@ import { estimateLineageCardHeight, generationAxisLabel, LINEAGE_CARD_BASE_HEIGHT, + LINEAGE_CARD_WIDTH, + LINEAGE_COMPACT_CARD_BASE_HEIGHT, + LINEAGE_COMPACT_CARD_WIDTH, + LINEAGE_COMPACT_NODE_WIDTH, + LINEAGE_NODE_PADDING_X, + LINEAGE_NODE_PADDING_Y, type LineageLayoutNode, type LineagePlayCountBreakdown, type LineageRelationRole, @@ -71,14 +78,6 @@ type GameLineagePageProps = { ) => void; }; -/** - * 窄屏紧凑卡片的基础高(176 宽画布里的广场卡)。 - * 真机实测(2026-10-07 重测,390×844 / 图谱视图 / 176 宽节点 / 角标行已回到封面下方): - * 16:9 封面 82.3 + 角标行 26.9 + 信息区(1 行标题)88.6 + 节点内边距/边框 24.4 ≈ **222**; - * 标题每多一行 +24(与 `LINEAGE_CARD_TITLE_LINE_HEIGHT` 同值)。 - */ -const LINEAGE_COMPACT_CARD_BASE_HEIGHT = 222; - /** 拖动阈值(像素):超过它才算「拖动」,否则一律当作点击,交给浏览器原生 click。 */ const DRAG_START_THRESHOLD_PX = 4; @@ -483,8 +482,9 @@ export function GameLineagePage({ filteredNodes, compactTree ? { - // 紧凑态:卡片 176 宽 → 16:9 封面 99 高 + 角标行 + 标题 + 作者 / 操作。 - nodeWidth: 176, + // 紧凑态:卡宽与清单卡同一个值(`LINEAGE_COMPACT_CARD_WIDTH`), + // 节点盒 = 卡宽 + 2×内边距 —— 不在这里另写 176 这类魔法数。 + nodeWidth: LINEAGE_COMPACT_NODE_WIDTH, nodeHeight: LINEAGE_COMPACT_CARD_BASE_HEIGHT, columnGap: 22, rowGap: 88, @@ -964,6 +964,19 @@ export function GameLineagePage({ return (
{embedded ? null : (