File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 622622
623623/* mermaid SVG 最大高さの制限(縦長すぎるのを防ぐ) */
624624.mermaid-wrapper {
625- max-height : 40 vh ;
625+ max-height : 60 vh ;
626626 overflow : auto;
627627}
628628
629629/* SVG 本体にも制限をかけて縦長表示を防ぐ(アスペクトを維持) */
630630.mermaid-wrapper .mermaid svg {
631- max-height : 80 vh ;
631+ max-height : 120 vh ;
632632 height : auto;
633633 max-width : 100% ;
634634 display : block;
Original file line number Diff line number Diff line change 1212 "use strict" ;
1313
1414 // Config
15- const MIN_SCALE = 0.25 ;
15+ const MIN_SCALE = 0.5 ;
1616 const MAX_SCALE = 4.0 ;
1717 const ZOOM_SENSITIVITY = 0.001 ;
1818
4646 // Even if we remove the property setting in JS, the CSS rule in blog.css might still apply it.
4747 // Setting it to 'auto' overrides the CSS and forces vector re-rendering on zoom.
4848 content . style . willChange = "auto" ;
49-
5049 content . style . transition = "transform 0.1s ease-out" ; // Smooth transition for small updates
5150
51+ // Disable native scroll to keep toolbar fixed and enable wheel panning
52+ wrapper . style . overflow = "hidden" ;
53+
5254 // RAF loop
5355 let rafId = null ;
5456 function updateTransform ( ) {
129131 scheduleUpdate ( ) ;
130132 }
131133
132- // Wheel Zoom
134+ // Wheel Zoom & Pan
133135 wrapper . addEventListener (
134136 "wheel" ,
135137 ( e ) => {
138+ e . preventDefault ( ) ;
139+
136140 if ( e . ctrlKey || e . metaKey ) {
137- e . preventDefault ( ) ;
141+ // Zoom
138142 const delta = - e . deltaY ;
139143 const factor = Math . exp ( delta * ZOOM_SENSITIVITY ) ;
140144 const center = getPoint ( e . clientX , e . clientY ) ;
141145 zoomTo ( state . scale * factor , center ) ;
146+ } else {
147+ // Pan
148+ state . x -= e . deltaX ;
149+ state . y -= e . deltaY ;
150+ scheduleUpdate ( ) ;
142151 }
143152 } ,
144153 { passive : false } ,
You can’t perform that action at this time.
0 commit comments