mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Include comment about methods produced on the fly.
For easier searching.
This commit is contained in:
parent
fa15b083b0
commit
3234975e46
3 changed files with 9 additions and 0 deletions
|
@ -1164,6 +1164,9 @@ new function() { // // Scope to inject various curve evaluation methods
|
|||
// the need to create a Curve object first, as required by the code that
|
||||
// finds path intersections.
|
||||
function(name) {
|
||||
// NOTE: (For easier searching): This loop produces:
|
||||
// getPointAt, getTangentAt, getNormalAt, getWeightedTangentAt,
|
||||
// getWeightedNormalAt, getCurvatureAt
|
||||
this[name + 'At'] = function(offset, isParameter) {
|
||||
var values = this.getValues();
|
||||
return Curve[name](values, isParameter ? offset
|
||||
|
|
|
@ -512,6 +512,9 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{
|
|||
}
|
||||
}, Base.each(Curve.evaluateMethods, function(name) {
|
||||
// Produce getters for #getTangent() / #getNormal() / #getCurvature()
|
||||
// NOTE: (For easier searching): This loop produces:
|
||||
// getPointAt, getTangentAt, getNormalAt, getWeightedTangentAt,
|
||||
// getWeightedNormalAt, getCurvatureAt
|
||||
var get = name + 'At';
|
||||
this[name] = function() {
|
||||
var parameter = this.getParameter(),
|
||||
|
|
|
@ -1679,6 +1679,9 @@ var Path = PathItem.extend(/** @lends Path# */{
|
|||
// TODO: contains(item)
|
||||
}, Base.each(Curve.evaluateMethods,
|
||||
function(name) {
|
||||
// NOTE: (For easier searching): This loop produces:
|
||||
// getPointAt, getTangentAt, getNormalAt, getWeightedTangentAt,
|
||||
// getWeightedNormalAt, getCurvatureAt
|
||||
this[name + 'At'] = function(offset, isParameter) {
|
||||
var loc = this.getLocationAt(offset, isParameter);
|
||||
return loc && loc[name]();
|
||||
|
|
Loading…
Reference in a new issue