Skip to content

Commit

Permalink
refactor: reaplace zoomTo by scale
Browse files Browse the repository at this point in the history
  • Loading branch information
LinStan committed Jul 31, 2024
1 parent 921499b commit 4aa2f7e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/diff/src/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ export const syncGraph = (
}

let isSyncing = false;
graph1.on('scale', ({ sx }) => {
graph1.on('scale', ({ sx, sy }) => {
if (!isSyncing) {
isSyncing = true;
graph2.zoomTo(sx);
graph2.scale(sx, sy);
isSyncing = false;
}
});
Expand All @@ -182,10 +182,10 @@ export const syncGraph = (
}
});

graph2.on('scale', ({ sx }) => {
graph2.on('scale', ({ sx, sy }) => {
if (!isSyncing) {
isSyncing = true;
graph1.zoomTo(sx);
graph1.scale(sx, sy);
isSyncing = false;
}
});
Expand Down

0 comments on commit 4aa2f7e

Please sign in to comment.