From add28666cf689c83a2bd8de8d6bba03402dbb58e Mon Sep 17 00:00:00 2001 From: Evgeniy Malyarov Date: Mon, 11 Jan 2016 15:54:07 +0500 Subject: [PATCH] Update Path.js fix getNearestPoint error on uninserted curves ; Conflicts: ; src/path/Path.js --- src/path/Curve.js | 2 +- src/path/PathItem.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/path/Curve.js b/src/path/Curve.js index 8a66c914..099d706a 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -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; } /** diff --git a/src/path/PathItem.js b/src/path/PathItem.js index 509e6278..e8c84beb 100644 --- a/src/path/PathItem.js +++ b/src/path/PathItem.js @@ -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; }, /**