Skip to content

Commit

Permalink
Merge pull request #361 from FrankiePo/fix-point-typing
Browse files Browse the repository at this point in the history
Improve point type
  • Loading branch information
davidfig authored Dec 22, 2021
2 parents 4bff2ce + d4b47d6 commit 6970287
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Viewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,9 @@ export class Viewport extends Container
public moveCenter(x: number, y: number): Viewport;

/** Move center of viewport to {@code center}. */
public moveCenter(center: Point): Viewport;
public moveCenter(center: IPointData): Viewport;

public moveCenter(...args: [number, number] | [Point]): Viewport
public moveCenter(...args: [number, number] | [IPointData]): Viewport
{
let x: number;
let y: number;
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/Animate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Point } from '@pixi/math';
import { IPointData, Point } from '@pixi/math';
import { Plugin } from './Plugin';
import ease from '../ease';

Expand All @@ -10,7 +10,7 @@ export interface IAnimateOptions {
time?: number;

/** Position to move the viewport to */
position?: Point;
position?: IPointData;

/**
* Desired viewport width in world pixels
Expand Down Expand Up @@ -210,7 +210,7 @@ export class Animate extends Plugin
}
if (!this.keepCenter)
{
this.parent.moveCenter(this.options.position as Point);
this.parent.moveCenter(this.options.position!);
}

this.parent.emit('animate-end', this.parent);
Expand Down

0 comments on commit 6970287

Please sign in to comment.