From c8d945f39b3800fb4f2d0cf3fec9f213fd26a63d Mon Sep 17 00:00:00 2001 From: moklick Date: Sat, 14 Nov 2020 17:04:29 +0100 Subject: [PATCH] refactor(store): remove unused viewportBox --- src/store/index.ts | 2 -- src/utils/graph.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/store/index.ts b/src/store/index.ts index 41870cd3..1e6a86bc 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -42,7 +42,6 @@ type InitD3Zoom = { export interface StoreModel { width: number; height: number; - viewportBox: Computed; transform: Transform; elements: Elements; visibleNodes: Computed; @@ -140,7 +139,6 @@ export interface StoreModel { export const storeModel: StoreModel = { width: 0, height: 0, - viewportBox: computed((state) => ({ x: 0, y: 0, width: state.width, height: state.height })), transform: [0, 0, 1], elements: [], nodes: computed((state) => state.elements.filter(isNode)), diff --git a/src/utils/graph.ts b/src/utils/graph.ts index 9285e59a..7af52a57 100644 --- a/src/utils/graph.ts +++ b/src/utils/graph.ts @@ -206,7 +206,7 @@ export const getNodesInside = ( const overlappingArea = Math.ceil(xOverlap * yOverlap); if (width === null || height === null || isDragging) { - // at the beginnning all nodes have width & height === 0 + // nodes are initialized with width and height = null return true; }