mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-03-13 16:33:28 -04:00
Use 'preserve' to protect #getPoint() against overriding.
This commit is contained in:
parent
3ae0ca6c94
commit
60109e897a
1 changed files with 10 additions and 9 deletions
|
@ -460,15 +460,16 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{
|
|||
}
|
||||
}, Base.each(Curve.evaluateMethods, function(name) {
|
||||
// Produce getters for #getTangent() / #getNormal() / #getCurvature()
|
||||
if (name !== 'getPoint') {
|
||||
var get = name + 'At';
|
||||
this[name] = function() {
|
||||
var parameter = this.getParameter(),
|
||||
curve = this.getCurve();
|
||||
return parameter != null && curve && curve[get](parameter, true);
|
||||
};
|
||||
}
|
||||
}, {}),
|
||||
var get = name + 'At';
|
||||
this[name] = function() {
|
||||
var parameter = this.getParameter(),
|
||||
curve = this.getCurve();
|
||||
return parameter != null && curve && curve[get](parameter, true);
|
||||
};
|
||||
}, {
|
||||
// Do not override the existing #getPoint():
|
||||
preserve: true
|
||||
}),
|
||||
new function() { // Scope for statics
|
||||
|
||||
function insert(locations, loc, merge) {
|
||||
|
|
Loading…
Reference in a new issue