Skip to content

Commit

Permalink
Update Path.js
Browse files Browse the repository at this point in the history
fix getNearestPoint error on uninserted curves
; Conflicts:
;	src/path/Path.js
  • Loading branch information
unpete authored and lehni committed Feb 14, 2016
1 parent fb76065 commit add2866
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/path/Curve.js
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ statics: /** @lends Curve */{
*/
getNearestPoint: function(/* point */) {
var loc = this.getNearestLocation.apply(this, arguments);
return loc ? loc.getPoint() : loc;
return loc ? loc.getPoint() : loc;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/path/PathItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ var PathItem = Item.extend(/** @lends PathItem# */{
* }
*/
getNearestPoint: function(/* point */) {
return this.getNearestLocation.apply(this, arguments).getPoint();
var loc = this.getNearestLocation.apply(this, arguments);
return loc ? loc.getPoint() : loc;
},

/**
Expand Down

0 comments on commit add2866

Please sign in to comment.