Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
vanruesc committed Feb 20, 2024
1 parent 4897e95 commit a957328
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/effects/ScanlineEffect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class ScanlineEffect extends Effect {
/**
* Constructs a new scanline effect.
*
* @param {Object} [options] - The options.
* @param options - The options.
*/

constructor({
Expand Down Expand Up @@ -84,7 +84,7 @@ export class ScanlineEffect extends Effect {
set density(value: number) {

this._density = value;
this.updateCount(this.resolution.height);
this.onResolutionChange(this.resolution);

}

Expand Down Expand Up @@ -121,13 +121,7 @@ export class ScanlineEffect extends Effect {

protected override onResolutionChange(resolution: Resolution) {

this.updateCount(resolution.height);

}

private updateCount(height: number) {

this.input.uniforms.get("count")!.value = Math.round(height * this.density);
this.input.uniforms.get("count")!.value = Math.round(resolution.height * this.density);

}

Expand Down

0 comments on commit a957328

Please sign in to comment.