Clean up white-space, comments and jshint errors.

This commit is contained in:
Jürg Lehni 2014-04-14 18:29:26 +02:00
parent d0d4b29856
commit 9ccba17fbe
7 changed files with 23 additions and 24 deletions

View file

@ -2060,7 +2060,7 @@ var Item = Base.extend(Callback, /** @lends Item# */{
// If the item is removed and inserted it again further above,
// the index needs to be adjusted accordingly.
if (item._parent === this._parent && index > this._index)
index--;
index--;
return item._parent.insertChild(index, this, _preserve);
},
@ -2083,8 +2083,8 @@ var Item = Base.extend(Callback, /** @lends Item# */{
* possible.
*/
insertBelow: function(item, _preserve) {
return this._insert(false, item, _preserve);
},
return this._insert(false, item, _preserve);
},
/**
* Sends this item to the back of all other items within the same parent.
@ -2289,7 +2289,7 @@ var Item = Base.extend(Callback, /** @lends Item# */{
* @return Boolean
*/
isEmpty: function() {
return !this._children || this._children.length == 0;
return !this._children || this._children.length === 0;
},
/**
@ -3029,7 +3029,7 @@ var Item = Base.extend(Callback, /** @lends Item# */{
* <b>{@code event.delta}</b>: the time passed in seconds since the last
* frame event.
*
* @see View#onFrame
* @see View#onFrame
* @example {@paperscript}
* // Creating an animation:
*

View file

@ -159,7 +159,7 @@ var Raster = Item.extend(/** @lends Raster# */{
},
isEmpty: function() {
return this._size.width == 0 && this._size.height == 0;
return this._size.width === 0 && this._size.height === 0;
},
/**

View file

@ -1022,7 +1022,7 @@ new function() { // Scope for methods that require numerical integration
// Iteratively calculate curve range lengths, and add them up,
// using integration precision depending on the size of the
// range. This is much faster and also more precise than not
// modifing start and calculating total length each time.
// modifying start and calculating total length each time.
function f(t) {
var count = getIterations(start, t);
length += start < t
@ -1083,7 +1083,7 @@ new function() { // Scope for methods that require numerical integration
top = hull[0],
bottom = hull[1],
tMinClip, tMaxClip;
// Clip the convexhull with dMin and dMax
// Clip the convex-hull with dMin and dMax
tMinClip = clipConvexHull(top, bottom, dMin, dMax);
top.reverse();
bottom.reverse();
@ -1169,7 +1169,7 @@ new function() { // Scope for methods that require numerical integration
/*#*/ if (__options.fatlineClipping) {
/**
* Calculate the convex hull for the non-paramertic bezier curve D(ti, di(t))
* Calculate the convex hull for the non-parametric bezier curve D(ti, di(t))
* The ti is equally spaced across [0..1] [0, 1/3, 2/3, 1] for
* di(t), [dq0, dq1, dq2, dq3] respectively. In other words our CVs for the
* curve are already sorted in the X axis in the increasing order.
@ -1206,7 +1206,7 @@ new function() { // Scope for methods that require numerical integration
// p1 and p2 lie on the same sides of [ p0, p3 ]. The hull can be
// a triangle or a quadrilateral and line [ p0, p3 ] is part of the
// hull. Check if the hull is a triangle or a quadrilateral.
// Also, if atleast one of the distances for p1 or p2, from line
// Also, if at least one of the distances for p1 or p2, from line
// [p0, p3] is zero then hull must at most have 3 vertices.
var pmax, cross = 0,
distZero = dist1 === 0 || dist2 === 0;
@ -1318,7 +1318,7 @@ new function() { // Scope for methods that require numerical integration
}
var roots = [],
count = Curve.solveCubic(rvc, 1, 0, roots, 0, 1);
// NOTE: count could be -1 for inifnite solutions, but that should only
// NOTE: count could be -1 for infinite solutions, but that should only
// happen with lines, in which case we should not be here.
for (var i = 0; i < count; i++) {
var tc = roots[i],

View file

@ -2384,7 +2384,7 @@ var Path = PathItem.extend(/** @lends Path# */{
'Cannot create an arc with the given arguments');
center = new Point(rx * y / ry, -ry * x / rx)
// "...where the + sign is chosen if fA != fS,
// and the sign is chosen if fA = fS."
// and the - sign is chosen if fA = fS."
.multiply((large === clockwise ? -1 : 1)
* Math.sqrt(factor))
.rotate(rotation).add(middle);
@ -2393,7 +2393,7 @@ var Path = PathItem.extend(/** @lends Path# */{
matrix = new Matrix().translate(center).rotate(rotation)
.scale(rx, ry);
// Transform from and to to the unit circle coordinate space
// and calculcate start vector and extend from there.
// and calculate start vector and extend from there.
vector = matrix._inverseTransform(from);
extent = vector.getDirectedAngle(matrix._inverseTransform(to));
// "...if fS = 0 and extent is > 0, then subtract 360, whereas
@ -2646,7 +2646,7 @@ statics: {
// When both handles are set in a segment and they are collinear,
// the join setting is ignored and round is always used.
var handleIn = segment._handleIn,
handleOut = segment._handleOut
handleOut = segment._handleOut;
if (join === 'round' || !handleIn.isZero() && !handleOut.isZero()
&& handleIn.isColinear(handleOut)) {
addRound(segment);
@ -2770,7 +2770,7 @@ statics: {
// or the last segment of the open path, in order to determine in which
// direction to move the point.
if (cap === 'square')
point = point.add(normal.rotate(loc.getParameter() == 0 ? -90 : 90));
point = point.add(normal.rotate(loc.getParameter() === 0 ? -90 : 90));
addPoint(point.add(normal));
addPoint(point.subtract(normal));
},
@ -2792,7 +2792,7 @@ statics: {
segment._transformCoordinates(matrix, coords, false);
for (var j = 0; j < 6; j += 2) {
// Use different padding for points or handles
var padding = j == 0 ? joinPadding : strokePadding,
var padding = j === 0 ? joinPadding : strokePadding,
paddingX = padding ? padding[0] : 0,
paddingY = padding ? padding[1] : 0,
x = coords[j],

View file

@ -202,7 +202,7 @@ var PathFitter = Base.extend({
return u - diff.dot(pt1) / df;
},
// Evaluate a Bezier curve at a particular parameter value
// Evaluate a bezier curve at a particular parameter value
evaluate: function(degree, curve, t) {
// Copy array
var tmp = curve.slice();

View file

@ -82,7 +82,7 @@ PathItem.inject(new function() {
collect(_path2._children || [_path2]);
// Propagate the winding contribution. Winding contribution of curves
// does not change between two intersections.
// First, sort all segments with an intersection to the begining.
// First, sort all segments with an intersection to the beginning.
segments.sort(function(a, b) {
var _a = a._intersection,
_b = b._intersection;
@ -312,7 +312,7 @@ PathItem.inject(new function() {
/**
* Private method to trace closed contours from a set of segments according
* to a set of constraintswinding contribution and a custom operator.
* to a set of constraints-winding contribution and a custom operator.
*
* @param {Segment[]} segments Array of 'seed' segments for tracing closed
* contours
@ -440,11 +440,11 @@ PathItem.inject(new function() {
* Returns the winding contribution of the given point with respect to
* this PathItem.
*
* @param {Point} point the location for which to determine the winding
* @param {Point} point the location for which to determine the winding
* direction
* @param {Boolean} horizontal whether we need to consider this point
* as part of a horizontal curve
* @param {Boolean} testContains whether we need to consider this point
* @param {Boolean} horizontal whether we need to consider this point as
* part of a horizontal curve
* @param {Boolean} testContains whether we need to consider this point
* as part of stationary points on the curve itself, used when checking
* the winding about a point.
* @return {Number} the winding number

View file

@ -41,7 +41,6 @@
* circle.fillColor = '#ff0000';
*/
var Color = Base.extend(new function() {
var types = {
gray: ['gray'],
rgb: ['red', 'green', 'blue'],