Skip to content

Commit

Permalink
Handing not-numeric x,y properties in point attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-polyakov committed Mar 4, 2019
1 parent e5c624f commit d867a22
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions dist/pixi-inspector.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/pixi-inspector.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/pixi-inspector.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pixi-inspector.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pixi-inspector",
"description": "Browsing and changing attributes of PixiJS display objects in DOM inspector.",
"version": "1.0.3",
"version": "1.0.4",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions src/attributes/PointAttributeParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export class PointAttributeParser implements AttributeParser<{ x: number, y: num

stringify(value: { x: number, y: number }): string {
if (value) {
let x = value.x.toFixed(this.numberPrecision);
let y = value.y.toFixed(this.numberPrecision);
let x = (value.x || 0).toFixed(this.numberPrecision);
let y = (value.y || 0).toFixed(this.numberPrecision);
return x == y ? x : x + ',' + y;
}
return '';
}

visible(value: { x: number, y: number }): boolean {
return value != null;
return value != null && !isNaN(value.x) && !isNaN(value.y);
}
}

0 comments on commit d867a22

Please sign in to comment.