mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Clean up docs and fix spelling mistakes.
This commit is contained in:
parent
5f466bbc7e
commit
8395541298
9 changed files with 25 additions and 9 deletions
5
node_modules/.gitignore
generated
vendored
5
node_modules/.gitignore
generated
vendored
|
@ -1,7 +1,8 @@
|
||||||
.bin
|
.bin
|
||||||
canvas
|
canvas
|
||||||
|
grunt*
|
||||||
|
jsdoc
|
||||||
jsdom
|
jsdom
|
||||||
|
prepro
|
||||||
request
|
request
|
||||||
uglify-js
|
uglify-js
|
||||||
prepro
|
|
||||||
grunt*
|
|
||||||
|
|
|
@ -211,7 +211,7 @@ Base.inject(/** @lends Base# */{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads all readable arguments from the list, handling nested arrays
|
* Reads all readable arguments from the list, handling nested arrays
|
||||||
* seperately.
|
* separately.
|
||||||
* @param {Array} list the list to read from, either an arguments object
|
* @param {Array} list the list to read from, either an arguments object
|
||||||
* or a normal array.
|
* or a normal array.
|
||||||
* @param {Number} start the index at which to start reading in the list
|
* @param {Number} start the index at which to start reading in the list
|
||||||
|
|
|
@ -46,7 +46,7 @@ var DomElement = new function() {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return /** @lends DomElement */{
|
||||||
create: function(nodes, parent) {
|
create: function(nodes, parent) {
|
||||||
var isArray = Array.isArray(nodes),
|
var isArray = Array.isArray(nodes),
|
||||||
res = create(isArray ? nodes : arguments, isArray ? parent : null);
|
res = create(isArray ? nodes : arguments, isArray ? parent : null);
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* @namespace
|
* @namespace
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
var DomEvent = {
|
var DomEvent = /** @lends DomEvent */{
|
||||||
add: function(el, events) {
|
add: function(el, events) {
|
||||||
for (var type in events)
|
for (var type in events)
|
||||||
el.addEventListener(type, events[type], false);
|
el.addEventListener(type, events[type], false);
|
||||||
|
|
|
@ -556,7 +556,7 @@ statics: {
|
||||||
},
|
},
|
||||||
|
|
||||||
getParameterOf: function(v, x, y) {
|
getParameterOf: function(v, x, y) {
|
||||||
// Handle beginnings and end seperately, as they are not detected
|
// Handle beginnings and end separately, as they are not detected
|
||||||
// sometimes.
|
// sometimes.
|
||||||
var tolerance = /*#=*/ Numerical.TOLERANCE;
|
var tolerance = /*#=*/ Numerical.TOLERANCE;
|
||||||
if (Math.abs(v[0] - x) < tolerance && Math.abs(v[1] - y) < tolerance)
|
if (Math.abs(v[0] - x) < tolerance && Math.abs(v[1] - y) < tolerance)
|
||||||
|
@ -675,7 +675,7 @@ statics: {
|
||||||
c = v1 - v0,
|
c = v1 - v0,
|
||||||
count = Numerical.solveQuadratic(a, b, c, roots),
|
count = Numerical.solveQuadratic(a, b, c, roots),
|
||||||
// Add some tolerance for good roots, as t = 0 / 1 are added
|
// Add some tolerance for good roots, as t = 0 / 1 are added
|
||||||
// seperately anyhow, and we don't want joins to be added with
|
// separately anyhow, and we don't want joins to be added with
|
||||||
// radiuses in getStrokeBounds()
|
// radiuses in getStrokeBounds()
|
||||||
tMin = /*#=*/ Numerical.TOLERANCE,
|
tMin = /*#=*/ Numerical.TOLERANCE,
|
||||||
tMax = 1 - tMin;
|
tMax = 1 - tMin;
|
||||||
|
|
|
@ -15,6 +15,11 @@
|
||||||
// from "Graphics Gems", Academic Press, 1990
|
// from "Graphics Gems", Academic Press, 1990
|
||||||
// Modifications and optimisations of original algorithm by Juerg Lehni.
|
// Modifications and optimisations of original algorithm by Juerg Lehni.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name PathFitter
|
||||||
|
* @class
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
var PathFitter = Base.extend({
|
var PathFitter = Base.extend({
|
||||||
initialize: function(path, error) {
|
initialize: function(path, error) {
|
||||||
this.points = [];
|
this.points = [];
|
||||||
|
|
|
@ -10,6 +10,11 @@
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name PathFlattener
|
||||||
|
* @class
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
var PathFlattener = Base.extend({
|
var PathFlattener = Base.extend({
|
||||||
initialize: function(path) {
|
initialize: function(path) {
|
||||||
this.curves = []; // The curve values as returned by getValues()
|
this.curves = []; // The curve values as returned by getValues()
|
||||||
|
|
|
@ -143,7 +143,7 @@ var CanvasView = View.extend(/** @lends CanvasView# */{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return /** @lends CanvasView# */{
|
||||||
/**
|
/**
|
||||||
* Returns true if event was stopped, false otherwise, whether handler
|
* Returns true if event was stopped, false otherwise, whether handler
|
||||||
* was called or not!
|
* was called or not!
|
||||||
|
|
|
@ -10,6 +10,11 @@
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name Numerical
|
||||||
|
* @namespace
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
var Numerical = new function() {
|
var Numerical = new function() {
|
||||||
|
|
||||||
// Lookup tables for abscissas and weights with values for n = 2 .. 16.
|
// Lookup tables for abscissas and weights with values for n = 2 .. 16.
|
||||||
|
@ -75,7 +80,7 @@ var Numerical = new function() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return /** @lends Numerical */{
|
||||||
TOLERANCE: TOLERANCE,
|
TOLERANCE: TOLERANCE,
|
||||||
// Precision when comparing against 0
|
// Precision when comparing against 0
|
||||||
EPSILON: EPSILON,
|
EPSILON: EPSILON,
|
||||||
|
|
Loading…
Reference in a new issue