refactor(store): remove unused viewportBox
This commit is contained in:
@@ -42,7 +42,6 @@ type InitD3Zoom = {
|
|||||||
export interface StoreModel {
|
export interface StoreModel {
|
||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
viewportBox: Computed<StoreModel, Rect>;
|
|
||||||
transform: Transform;
|
transform: Transform;
|
||||||
elements: Elements;
|
elements: Elements;
|
||||||
visibleNodes: Computed<StoreModel, Node[]>;
|
visibleNodes: Computed<StoreModel, Node[]>;
|
||||||
@@ -140,7 +139,6 @@ export interface StoreModel {
|
|||||||
export const storeModel: StoreModel = {
|
export const storeModel: StoreModel = {
|
||||||
width: 0,
|
width: 0,
|
||||||
height: 0,
|
height: 0,
|
||||||
viewportBox: computed((state) => ({ x: 0, y: 0, width: state.width, height: state.height })),
|
|
||||||
transform: [0, 0, 1],
|
transform: [0, 0, 1],
|
||||||
elements: [],
|
elements: [],
|
||||||
nodes: computed((state) => state.elements.filter(isNode)),
|
nodes: computed((state) => state.elements.filter(isNode)),
|
||||||
|
|||||||
+1
-1
@@ -206,7 +206,7 @@ export const getNodesInside = (
|
|||||||
const overlappingArea = Math.ceil(xOverlap * yOverlap);
|
const overlappingArea = Math.ceil(xOverlap * yOverlap);
|
||||||
|
|
||||||
if (width === null || height === null || isDragging) {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user