Skip to content

Commit

Permalink
fix: issue I. + typo (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
louisgreiner authored Apr 9, 2024
1 parent c646b3f commit deb7cd1
Showing 1 changed file with 30 additions and 25 deletions.
55 changes: 30 additions & 25 deletions src/app/view/editor-main-view/data-views/editor.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ export class EditorView implements SVGMouseControllerObserver {

constructor(
controller: EditorMainViewComponent,
private nodeSerivce: NodeService,
private nodeService: NodeService,
private trainrunService: TrainrunService,
private trainrunSectionService: TrainrunSectionService,
private noteService: NoteService,
private filterService: FilterService,
private uiInteractionService: UiInteractionService,
private undoService: UndoService,
private copySerivce: CopyService,
private copyService: CopyService,
private logService: LogService,
) {
this.controller = controller;
Expand All @@ -133,21 +133,21 @@ export class EditorView implements SVGMouseControllerObserver {
this.connectionsView = new ConnectionsView(this);
this.trainrunSectionsView = new TrainrunSectionsView(this);
this.trainrunSectionPreviewLineView = new TrainrunSectionPreviewLineView(
nodeSerivce,
nodeService,
filterService,
);
this.multiSelectRenderer = new MultiSelectRenderer();
this.notesView = new NotesView(this);
this.editorKeyEvents = new EditorKeyEvents(
nodeSerivce,
nodeService,
trainrunService,
trainrunSectionService,
noteService,
filterService,
uiInteractionService,
logService,
undoService,
copySerivce,
copyService,
this.svgMouseController,
this.trainrunSectionPreviewLineView,
);
Expand Down Expand Up @@ -442,36 +442,41 @@ export class EditorView implements SVGMouseControllerObserver {
if (!this.isMultiSelectOn) {
return;
}
const allNodesOfInterest = this.nodeSerivce.getNodes().filter((n: Node) => {
this.nodeSerivce.unselectNode(n.getId(), false);
if (
topLeft.getX() < n.getPositionX() &&
n.getPositionX() + n.getNodeWidth() < bottomRight.getX()
) {

const allNodesOfInterest = this.nodeService.getNodes().filter((n: Node) => {
this.nodeService.unselectNode(n.getId(), false);
if (this.filterService.filterNode(n)) {
if (
topLeft.getY() < n.getPositionY() &&
n.getPositionY() + n.getNodeHeight() < bottomRight.getY()
topLeft.getX() < n.getPositionX() &&
n.getPositionX() + n.getNodeWidth() < bottomRight.getX()
) {
return true;
if (
topLeft.getY() < n.getPositionY() &&
n.getPositionY() + n.getNodeHeight() < bottomRight.getY()
) {
return true;
}
}
}
return false;
});
allNodesOfInterest.forEach((n: Node) => {
this.nodeSerivce.selectNode(n.getId(), false);
this.nodeService.selectNode(n.getId(), false);
});

const allNotesOfInterest = this.noteService.getNotes().filter((n: Note) => {
this.noteService.unselectNote(n.getId(), false);
if (
topLeft.getX() < n.getPositionX() &&
n.getPositionX() + n.getWidth() < bottomRight.getX()
) {
if (this.filterService.filterNote(n)) {
if (
topLeft.getY() < n.getPositionY() &&
n.getPositionY() + n.getHeight() < bottomRight.getY()
topLeft.getX() < n.getPositionX() &&
n.getPositionX() + n.getWidth() < bottomRight.getX()
) {
return true;
if (
topLeft.getY() < n.getPositionY() &&
n.getPositionY() + n.getHeight() < bottomRight.getY()
) {
return true;
}
}
}
return false;
Expand All @@ -480,7 +485,7 @@ export class EditorView implements SVGMouseControllerObserver {
this.noteService.selectNote(n.getId(), false);
});

this.nodeSerivce.nodesUpdated();
this.nodeService.nodesUpdated();
this.noteService.notesUpdated();
this.multiSelectRenderer.updateBox(topLeft, bottomRight);
}
Expand All @@ -493,7 +498,7 @@ export class EditorView implements SVGMouseControllerObserver {
this.multiSelectRenderer.undisplayBox();

if (
this.nodeSerivce.getSelectedNode() === null &&
this.nodeService.getSelectedNode() === null &&
this.noteService.getSelectedNote() === null
) {
this.uiInteractionService.setEditorMode(EditorMode.NetzgrafikEditing);
Expand All @@ -517,7 +522,7 @@ export class EditorView implements SVGMouseControllerObserver {
} else if (this.isAnyTrainSelected()) {
this.unselectAllTrainruns();
} else {
this.nodeSerivce.unselectAllNodes();
this.nodeService.unselectAllNodes();
this.uiInteractionService.closeNodeStammdaten();
}
if (
Expand Down

0 comments on commit deb7cd1

Please sign in to comment.