From 870fef3389a896c6d5c7ba22cef381be9d1ea95a Mon Sep 17 00:00:00 2001
From: "Thomas F. K. Jorna" <thomasfkjorna@gmail.com>
Date: Sun, 1 Aug 2021 18:03:56 +0200
Subject: fix: made local mode zoom  more consistent

---
 pages/index.tsx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'pages/index.tsx')

diff --git a/pages/index.tsx b/pages/index.tsx
index 82c203c..7789a38 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -173,14 +173,16 @@ export function GraphPage() {
     if (!sr.nodeIds.length) {
       setScope({ nodeIds: [emacsNode] })
       setTimeout(() => {
-        fg.zoomToFit(speed, padding, (node: OrgRoamNode) => nodes[node.id!])
+        /* fg.zoomToFit(speed, padding, (node: OrgRoamNode) => nodes[node.id!]) */
+        fg.centerAt(0, 0, speed)
       }, 50)
       return
     }
     if (bh.localSame !== 'add') {
       setScope({ nodeIds: [emacsNode] })
       setTimeout(() => {
-        fg.zoomToFit(speed, padding, (node: OrgRoamNode) => nodes[node.id!])
+        /* fg.zoomToFit(speed, padding, (node: OrgRoamNode) => nodes[node.id!]) */
+        fg.centerAt(0, 0, speed)
       }, 50)
       return
     }
@@ -194,7 +196,8 @@ export function GraphPage() {
     ) {
       setScope({ nodeIds: [emacsNode] })
       setTimeout(() => {
-        fg.zoomToFit(speed, padding, (node: OrgRoamNode) => nodes[node.id!])
+        /* fg.zoomToFit(speed, padding, (node: OrgRoamNode) => nodes[node.id!]) */
+        fg.centerAt(0, 0, speed)
       }, 50)
       return
     }
-- 
cgit v1.2.3

