mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -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
|
// the need to create a Curve object first, as required by the code that
|
||||||
// finds path intersections.
|
// finds path intersections.
|
||||||
function(name) {
|
function(name) {
|
||||||
|
// NOTE: (For easier searching): This loop produces:
|
||||||
|
// getPointAt, getTangentAt, getNormalAt, getWeightedTangentAt,
|
||||||
|
// getWeightedNormalAt, getCurvatureAt
|
||||||
this[name + 'At'] = function(offset, isParameter) {
|
this[name + 'At'] = function(offset, isParameter) {
|
||||||
var values = this.getValues();
|
var values = this.getValues();
|
||||||
return Curve[name](values, isParameter ? offset
|
return Curve[name](values, isParameter ? offset
|
||||||
|
|
|
@ -512,6 +512,9 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{
|
||||||
}
|
}
|
||||||
}, Base.each(Curve.evaluateMethods, function(name) {
|
}, Base.each(Curve.evaluateMethods, function(name) {
|
||||||
// Produce getters for #getTangent() / #getNormal() / #getCurvature()
|
// Produce getters for #getTangent() / #getNormal() / #getCurvature()
|
||||||
|
// NOTE: (For easier searching): This loop produces:
|
||||||
|
// getPointAt, getTangentAt, getNormalAt, getWeightedTangentAt,
|
||||||
|
// getWeightedNormalAt, getCurvatureAt
|
||||||
var get = name + 'At';
|
var get = name + 'At';
|
||||||
this[name] = function() {
|
this[name] = function() {
|
||||||
var parameter = this.getParameter(),
|
var parameter = this.getParameter(),
|
||||||
|
|
|
@ -1679,6 +1679,9 @@ var Path = PathItem.extend(/** @lends Path# */{
|
||||||
// TODO: contains(item)
|
// TODO: contains(item)
|
||||||
}, Base.each(Curve.evaluateMethods,
|
}, Base.each(Curve.evaluateMethods,
|
||||||
function(name) {
|
function(name) {
|
||||||
|
// NOTE: (For easier searching): This loop produces:
|
||||||
|
// getPointAt, getTangentAt, getNormalAt, getWeightedTangentAt,
|
||||||
|
// getWeightedNormalAt, getCurvatureAt
|
||||||
this[name + 'At'] = function(offset, isParameter) {
|
this[name + 'At'] = function(offset, isParameter) {
|
||||||
var loc = this.getLocationAt(offset, isParameter);
|
var loc = this.getLocationAt(offset, isParameter);
|
||||||
return loc && loc[name]();
|
return loc && loc[name]();
|
||||||
|
|
Loading…
Reference in a new issue