refactor(store): get rid of unused selection
This commit is contained in:
@@ -67,7 +67,6 @@ export interface StoreModel {
|
|||||||
|
|
||||||
nodesSelectionActive: boolean;
|
nodesSelectionActive: boolean;
|
||||||
selectionActive: boolean;
|
selectionActive: boolean;
|
||||||
selection: SelectionRect | null;
|
|
||||||
|
|
||||||
userSelectionRect: SelectionRect;
|
userSelectionRect: SelectionRect;
|
||||||
|
|
||||||
@@ -154,7 +153,6 @@ export const storeModel: StoreModel = {
|
|||||||
|
|
||||||
nodesSelectionActive: false,
|
nodesSelectionActive: false,
|
||||||
selectionActive: false,
|
selectionActive: false,
|
||||||
selection: null,
|
|
||||||
|
|
||||||
userSelectionRect: {
|
userSelectionRect: {
|
||||||
startX: 0,
|
startX: 0,
|
||||||
@@ -226,7 +224,6 @@ export const storeModel: StoreModel = {
|
|||||||
|
|
||||||
if (state.snapToGrid) {
|
if (state.snapToGrid) {
|
||||||
const [gridSizeX, gridSizeY] = state.snapGrid;
|
const [gridSizeX, gridSizeY] = state.snapGrid;
|
||||||
|
|
||||||
position = {
|
position = {
|
||||||
x: gridSizeX * Math.round(pos.x / gridSizeX),
|
x: gridSizeX * Math.round(pos.x / gridSizeX),
|
||||||
y: gridSizeY * Math.round(pos.y / gridSizeY),
|
y: gridSizeY * Math.round(pos.y / gridSizeY),
|
||||||
@@ -276,7 +273,6 @@ export const storeModel: StoreModel = {
|
|||||||
const nextSelectedElements = [...selectedNodes, ...selectedEdges];
|
const nextSelectedElements = [...selectedNodes, ...selectedEdges];
|
||||||
const selectedElementsUpdated = !isEqual(nextSelectedElements, state.selectedElements);
|
const selectedElementsUpdated = !isEqual(nextSelectedElements, state.selectedElements);
|
||||||
|
|
||||||
state.selection = nextRect;
|
|
||||||
state.userSelectionRect = nextRect;
|
state.userSelectionRect = nextRect;
|
||||||
|
|
||||||
if (selectedElementsUpdated) {
|
if (selectedElementsUpdated) {
|
||||||
@@ -298,7 +294,6 @@ export const storeModel: StoreModel = {
|
|||||||
|
|
||||||
const selectedNodesBbox = getRectOfNodes(selectedNodes);
|
const selectedNodesBbox = getRectOfNodes(selectedNodes);
|
||||||
|
|
||||||
state.selection = state.userSelectionRect;
|
|
||||||
state.nodesSelectionActive = true;
|
state.nodesSelectionActive = true;
|
||||||
state.selectedNodesBbox = selectedNodesBbox;
|
state.selectedNodesBbox = selectedNodesBbox;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user