Skip to content

Database diagrams editor that allows you to visualize and design your DB with a single query.

fix set minimum zoom for 80% when clicking show all button

johnnyfishdb89e67f7a1e
diff --git a/src/pages/editor-page/canvas/toolbar/toolbar.tsx b/src/pages/editor-page/canvas/toolbar/toolbar.tsx
index 0b9348f2..c4d2f44f 100644
--- a/src/pages/editor-page/canvas/toolbar/toolbar.tsx
+++ b/src/pages/editor-page/canvas/toolbar/toolbar.tsx
@@ -1,4 +1,4 @@
-import React, { useState } from 'react';
+import React, { useCallback, useState } from 'react';
import { Card, CardContent } from '@/components/card/card';
import { ZoomIn, ZoomOut, Save, Redo, Undo, Scan } from 'lucide-react';
import { Separator } from '@/components/separator/separator';
@@ -47,9 +47,13 @@ export const Toolbar: React.FC<ToolbarProps> = () => {
});
};
- const showAll = () => {
- fitView({ duration: zoomDuration });
- };
+ const showAll = useCallback(() => {
+ fitView({
+ duration: 500,
+ padding: 0.1,
+ maxZoom: 0.8,
+ });
+ }, [fitView]);
return (
<div className="px-1">