Skip to content

fix: Mermaid 图表按原始尺寸显示,仅超宽时缩小 - #74

Merged
shaohaozhi286 merged 1 commit into
masterfrom
codex/fix-mermaid-intrinsic-size
Sep 27, 2026
Merged

shaohaozhi286 merged 1 commit into
masterfrom
codex/fix-mermaid-intrinsic-size

Conversation

@shaohaozhi286

Copy link
Copy Markdown
Collaborator

Mermaid 图表在对话中可能被 SVG 的百分比宽度撑大。现在使用解析出的原始图表宽度,超过容器宽度时等比缩小;小图保持原始尺寸,点击放大预览保持可用。

验证:

  • pnpm test 通过(2877 条 pass 输出)。
  • pnpm build 与 git diff --check 通过。
  • 浏览器实测 1600px / 390px 视口及 100% / 125% / 150% DPR:322.7px 小图保持原宽;2990.75px 大图分别缩至 1534px / 324px,宽高比正确;窗口恢复后尺寸正确,预览事件携带原始尺寸。
  • 尚未重新打包桌面客户端。

@shaohaozhi286
shaohaozhi286 merged commit 9de0344 into master Sep 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants