Skip to content

Commit 281931d

Browse files
committed
fix(postprocessing): use renamed selection api
1 parent 52fe340 commit 281931d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

libs/postprocessing/src/lib/effects/outline.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
input,
1010
untracked,
1111
} from '@angular/core';
12-
import { injectStore, NgtArgs, NgtSelection, omit, pick, resolveRef } from 'angular-three';
12+
import { injectStore, NgtArgs, NgtSelectionApi, omit, pick, resolveRef } from 'angular-three';
1313
import { mergeInputs } from 'ngxtension/inject-inputs';
1414
import { OutlineEffect } from 'postprocessing';
1515
import * as THREE from 'three';
@@ -36,7 +36,7 @@ const defaultOptions: NgtpOutlineOptions = {
3636
export class NgtpOutline {
3737
options = input(defaultOptions, { transform: mergeInputs(defaultOptions) });
3838

39-
private ngtSelection = inject(NgtSelection, { optional: true });
39+
private selectionApi = inject(NgtSelectionApi, { optional: true });
4040
private effectComposer = inject(NgtpEffectComposer);
4141
private store = injectStore();
4242

@@ -135,7 +135,7 @@ export class NgtpOutline {
135135

136136
effect((onCleanup) => {
137137
// NOTE: we run this effect if declarative NgtSelection is not enabled
138-
if (!this.ngtSelection) {
138+
if (!this.selectionApi) {
139139
// NOTE: if NgtSelection is not used and selection is not provided, we throw
140140
if (this.selection() === undefined) {
141141
throw new Error('[NGT PostProcessing]: ngtp-outline requires selection input or use NgtSelection');
@@ -149,10 +149,10 @@ export class NgtpOutline {
149149
}
150150

151151
// NOTE: we run this effect if declarative NgtSelection is enabled
152-
const selectionEnabled = this.ngtSelection.enabled();
152+
const selectionEnabled = this.selectionApi.enabled();
153153
if (!selectionEnabled) return;
154154
const cleanup = this.handleSelectionChangeEffect(
155-
this.ngtSelection.selected,
155+
this.selectionApi.selected,
156156
this.effect,
157157
this.store.invalidate,
158158
);

libs/postprocessing/src/lib/effects/selective-bloom.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
inject,
1212
input,
1313
} from '@angular/core';
14-
import { injectStore, NgtArgs, NgtSelection, pick, resolveRef } from 'angular-three';
14+
import { injectStore, NgtArgs, NgtSelectionApi, pick, resolveRef } from 'angular-three';
1515
import { mergeInputs } from 'ngxtension/inject-inputs';
1616
import { BlendFunction, BloomEffectOptions, SelectiveBloomEffect } from 'postprocessing';
1717
import * as THREE from 'three';
@@ -67,7 +67,7 @@ export class NgtpSelectiveBloom {
6767

6868
private store = injectStore();
6969
private effectComposer = inject(NgtpEffectComposer);
70-
private ngtSelection = inject(NgtSelection, { optional: true });
70+
private selectionApi = inject(NgtSelectionApi, { optional: true });
7171

7272
private resolvedLights = computed(() => this.lights().map((light) => resolveRef(light)));
7373
private resolvedSelected = computed(() => {
@@ -77,8 +77,8 @@ export class NgtpSelectiveBloom {
7777
return array.map((selected) => resolveRef(selected));
7878
});
7979
private resolvedNgtSelected = computed(() => {
80-
if (!this.ngtSelection || !this.ngtSelection.enabled) return [];
81-
return this.ngtSelection.selected().map((selected) => resolveRef(selected));
80+
if (!this.selectionApi || !this.selectionApi.enabled) return [];
81+
return this.selectionApi.selected().map((selected) => resolveRef(selected));
8282
});
8383

8484
protected effect = computed(() => {
@@ -107,7 +107,7 @@ export class NgtpSelectiveBloom {
107107
constructor() {
108108
effect((onCleanup) => {
109109
// skip input selection altogether if NgtSelection is used
110-
if (this.ngtSelection) return;
110+
if (this.selectionApi) return;
111111
const selection = this.resolvedSelected();
112112
if (!selection.length) return;
113113

0 commit comments

Comments
 (0)