mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Implement Path#getLocation(point)
This commit is contained in:
parent
55f815cb72
commit
254aee47f8
1 changed files with 11 additions and 1 deletions
|
@ -936,7 +936,17 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
|||
return null;
|
||||
},
|
||||
|
||||
// TODO: getLocationAt(point, precision)
|
||||
getLocation: function(point) {
|
||||
var curves = this.getCurves();
|
||||
for (var i = 0, l = curves.length; i < l; i++) {
|
||||
var curve = curves[i];
|
||||
var t = curve.getParameter(point);
|
||||
if (t != null)
|
||||
return new CurveLocation(curve, t);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
// PORT: Rename functions and add new isParameter argument in Scriptographer
|
||||
// DOCS: document Path#getLocationAt
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue