flowbook 0.2.16 → 0.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -121,6 +121,12 @@ export function MermaidRenderer({ code, className }: Props) {
|
|
|
121
121
|
};
|
|
122
122
|
}, [code, safeId]);
|
|
123
123
|
|
|
124
|
+
// Reset zoom & pan when switching to a different diagram
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
setScale(1);
|
|
127
|
+
setPos({ x: 0, y: 0 });
|
|
128
|
+
}, [code]);
|
|
129
|
+
|
|
124
130
|
// Wheel zoom (non-passive to allow preventDefault)
|
|
125
131
|
useEffect(() => {
|
|
126
132
|
const el = containerRef.current;
|