Skip to content

Commit b863cda

Browse files
authored
fix: changed filtering oder and add cull for notes (#429)
1 parent 0451042 commit b863cda

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

src/app/services/ui/filter.service.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -391,12 +391,10 @@ export class FilterService implements OnDestroy {
391391
trainrun.getLabelIds(),
392392
);
393393
return (
394+
filterTrainrunSection &&
394395
this.isFilterTrainrunFrequencyEnabled(trainrun.getTrainrunFrequency()) &&
395396
this.isFilterTrainrunCategoryEnabled(trainrun.getTrainrunCategory()) &&
396-
this.isFilterTrainrunTimeCategoryEnabled(
397-
trainrun.getTrainrunTimeCategory(),
398-
) &&
399-
filterTrainrunSection
397+
this.isFilterTrainrunTimeCategoryEnabled(trainrun.getTrainrunTimeCategory())
400398
);
401399
}
402400

@@ -868,14 +866,6 @@ export class FilterService implements OnDestroy {
868866
groupedLabelsFromEnvironment.filter(
869867
(value) => groupedLabelsAllMinusFilter.indexOf(value) !== -1,
870868
).length === groupedLabelsAllMinusFilter.length;
871-
console.log(
872-
"groupedLabelsAllMinusFilter",
873-
groupedLabelsAllMinusFilter,
874-
"groupedLabelsFromEnvironment",
875-
groupedLabelsFromEnvironment,
876-
"doFiltering",
877-
doFiltering,
878-
);
879869
}
880870
});
881871
return doFiltering;

src/app/view/editor-main-view/data-views/notes.view.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,16 @@ export class NotesView {
128128
}
129129

130130
displayNotes(inputNotes: Note[]) {
131-
const notes = inputNotes.filter((n) => this.filterNotesToDisplay(n));
131+
const notes = inputNotes.filter((n) =>
132+
this.editorView.doCullCheckPositionsInViewport(
133+
[
134+
new Vec2D(n.getPositionX(), n.getPositionY()),
135+
new Vec2D(n.getPositionX() + n.getWidth(), n.getPositionY()),
136+
new Vec2D(n.getPositionX(), n.getPositionY() + n.getHeight()),
137+
new Vec2D(n.getPositionX() + n.getWidth(), n.getPositionY() + n.getHeight())
138+
]) &&
139+
this.filterNotesToDisplay(n)
140+
);
132141

133142
const group = this.notesGroup
134143
.selectAll(StaticDomTags.NOTE_ROOT_CONTAINER_DOM_REF)

0 commit comments

Comments
 (0)