Skip to content

Commit

Permalink
Chore: GodRayFilter backward-compatibility (#425)
Browse files Browse the repository at this point in the history
* Chore: God Ray Filter Deprecations

* Cleanup

---------

Co-authored-by: Baz Utsahajit <[email protected]>
  • Loading branch information
bbazukun123 and bbazukun123 authored Feb 14, 2024
1 parent 9d90314 commit 0885658
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/godray/GodrayFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface GodrayFilterOptions
* once defined in the constructor
* @default {x:0,y:0}
*/
center?: PointData;
center?: PointData | number[];
/**
* General intensity of the effect. A value closer to 1 will produce a more intense effect,
* where a value closer to 0 will produce a subtler effect.
Expand Down Expand Up @@ -189,7 +189,15 @@ export class GodrayFilter extends Filter
* @default {x:0,y:0}
*/
get center(): PointData { return this._center; }
set center(value: PointData) { this._center = value; }
set center(value: PointData | number[])
{
if (Array.isArray(value))
{
value = { x: value[0], y: value[1] };
}

this._center = value;
}

/**
* Focal point for non-parallel rays on the `x` axis, to use this `parallel` must be set to `false`.
Expand Down

0 comments on commit 0885658

Please sign in to comment.