refactor(positions): remove unused node origins

This commit is contained in:
moklick
2024-06-27 15:03:35 +02:00
parent 1a51428bd4
commit 609f7ed792
12 changed files with 64 additions and 69 deletions
+1 -2
View File
@@ -288,7 +288,7 @@ const createStore = ({
return panBySystem({ delta, panZoom, transform, translateExtent, width, height });
},
fitView: (options?: FitViewOptions): boolean => {
const { panZoom, width, height, minZoom, maxZoom, nodeOrigin, nodeLookup } = get();
const { panZoom, width, height, minZoom, maxZoom, nodeLookup } = get();
if (!panZoom) {
return false;
@@ -302,7 +302,6 @@ const createStore = ({
panZoom,
minZoom,
maxZoom,
nodeOrigin,
},
options
);
-1
View File
@@ -46,7 +46,6 @@ const getInitialState = ({
if (fitView && width && height) {
// @todo users nodeOrigin should be used here
const bounds = getInternalNodesBounds(nodeLookup, {
nodeOrigin: [0, 0],
filter: (node) => !!((node.width || node.initialWidth) && (node.height || node.initialHeight)),
});
const { x, y, zoom } = getViewportForBounds(bounds, width, height, 0.5, 2, 0.1);