Use same notation for all injection scopes.

This commit is contained in:
Jürg Lehni 2015-09-06 16:48:23 +02:00
parent cf813faa75
commit b52d343527
8 changed files with 19 additions and 14 deletions

View file

@ -857,7 +857,8 @@ var LinkedRectangle = Rectangle.extend({
this._owner[this._setter](this);
return this;
}
}, new function() {
},
new function() {
var proto = Rectangle.prototype;
return Base.each(['x', 'y', 'width', 'height'], function(key) {

View file

@ -277,7 +277,6 @@ var Shape = Item.extend(/** @lends Shape# */{
}
},
new function() { // Scope for _contains() and _hitTestSelf() code.
// Returns the center of the quarter corner ellipse for rounded rectangle,
// if the point lies within its bounding box.
function getCornerCenter(that, point, expand) {

View file

@ -298,7 +298,8 @@ var CompoundPath = PathItem.extend(/** @lends CompoundPath# */{
: matrix.chain(mx));
}
}
}, new function() { // Injection scope for PostScript-like drawing functions
},
new function() { // Injection scope for PostScript-like drawing functions
/**
* Helper method that returns the current path and checks if a moveTo()
* command is required first.

View file

@ -1050,6 +1050,7 @@ statics: {
*/
},
new function() { // // Scope to inject various curve evaluation methods
var methods = ['getPoint', 'getTangent', 'getNormal', 'getWeightedTangent',
'getWeightedNormal', 'getCurvature'];
return Base.each(methods,
@ -1274,7 +1275,8 @@ new function() { // Scope for methods that require private functions
return evaluate(v, t, 3, false).x;
}
};
}, new function() { // Scope for intersection using bezier fat-line clipping
},
new function() { // Scope for intersection using bezier fat-line clipping
function addLocation(locations, include, curve1, t1, point1, curve2, t2,
point2) {
var loc = new CurveLocation(curve1, t1, point1, curve2, t2, point2);

View file

@ -2020,8 +2020,8 @@ var Path = PathItem.extend(/** @lends Path# */{
getNearestPoint: function(/* point */) {
return this.getNearestLocation.apply(this, arguments).getPoint();
}
}), new function() { // Scope for drawing
}),
new function() { // Scope for drawing
// Note that in the code below we're often accessing _x and _y on point
// objects that were read from segments. This is because the SegmentPoint
// class overrides the plain x / y properties with getter / setters and
@ -2220,8 +2220,8 @@ var Path = PathItem.extend(/** @lends Path# */{
drawHandles(ctx, this._segments, matrix, paper.settings.handleSize);
}
};
}, new function() { // Path Smoothing
},
new function() { // Path Smoothing
/**
* Solves a tri-diagonal system for one of coordinates (x or y) of first
* bezier control points.
@ -2346,7 +2346,8 @@ var Path = PathItem.extend(/** @lends Path# */{
}
}
};
}, new function() { // PostScript-style drawing commands
},
new function() { // PostScript-style drawing commands
/**
* Helper method that returns the current segment and checks if a moveTo()
* command is required first.

View file

@ -1112,7 +1112,8 @@ var Color = Base.extend(new function() {
}
}
});
}, new function() {
},
new function() {
var operators = {
add: function(a, b) {
return a + b;

View file

@ -144,8 +144,8 @@ var CanvasView = View.extend(/** @lends CanvasView# */{
project._needsUpdate = false;
return true;
}
}, new function() { // Item based mouse handling:
},
new function() { // Item based mouse handling:
var downPoint,
lastPoint,
overPoint,

View file

@ -673,8 +673,8 @@ var View = Base.extend(Emitter, /** @lends View# */{
return new CanvasView(project, element);
}
}
}, new function() {
// Injection scope for mouse events on the browser
},
new function() { // Injection scope for mouse events on the browser
/*#*/ if (__options.environment == 'browser') {
var tool,
prevFocus,