Skip to content

fix(docs): allow zooming out from initial auto-fit scale in mermaid modal#138

Merged
JusterZhu merged 2 commits into
mainfrom
docs/core-execution-flow
Jun 21, 2026
Merged

fix(docs): allow zooming out from initial auto-fit scale in mermaid modal#138
JusterZhu merged 2 commits into
mainfrom
docs/core-execution-flow

Conversation

@JusterZhu

Copy link
Copy Markdown
Collaborator

Problem

After PRs #136 and #137, the mermaid zoom modal opens with the SVG auto-fitted to fill the screen. However, once open, users cannot zoom out below the initial auto-fit scale because contain: 'outside' prevents the SVG from becoming smaller than the container.

Fix

Two-line change in src/theme/Mermaid/index.js:

Before After
contain: 'outside' contain: false
minScale: 0.1 minScale: 0.05

Removing contain allows the SVG to shrink freely. Lower minScale gives more zoom-out range.

🤖 Generated with Claude Code

…odal

Changed panzoom contain from 'outside' to false so users can freely
zoom out beyond the auto-fit size. Also reduced minScale to 0.05 to
allow more zoom-out range.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 21, 2026 06:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Attach wheel event listener on modal body that forwards to panzoom's
zoomWithWheel, so users can zoom in/out by scrolling the mouse wheel.

Co-Authored-By: Claude <noreply@anthropic.com>
@JusterZhu JusterZhu merged commit 1c1ecf9 into main Jun 21, 2026
2 checks passed
@JusterZhu JusterZhu deleted the docs/core-execution-flow branch June 21, 2026 06:43
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