mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Clean up whitespace.
This commit is contained in:
parent
84e31925b6
commit
74f797a9dd
6 changed files with 13 additions and 13 deletions
|
@ -478,7 +478,7 @@ Item = Base.extend({
|
||||||
while(parent) {
|
while(parent) {
|
||||||
// Find group parents. Check for parent.parent, since don't want
|
// Find group parents. Check for parent.parent, since don't want
|
||||||
// top level layers, because they also inherit from Group
|
// top level layers, because they also inherit from Group
|
||||||
if(parent.parent
|
if (parent.parent
|
||||||
&& (parent instanceof Group || parent instanceof CompoundPath)
|
&& (parent instanceof Group || parent instanceof CompoundPath)
|
||||||
&& item.isDescendant(parent))
|
&& item.isDescendant(parent))
|
||||||
return true;
|
return true;
|
||||||
|
@ -538,7 +538,7 @@ Item = Base.extend({
|
||||||
// weird results on Scriptographer. Also we can't use antialiasing, since
|
// weird results on Scriptographer. Also we can't use antialiasing, since
|
||||||
// Canvas doesn't support it yet. Document colorMode is also out of the
|
// Canvas doesn't support it yet. Document colorMode is also out of the
|
||||||
// question for now.
|
// question for now.
|
||||||
if(!resolution)
|
if (!resolution)
|
||||||
resolution = 72;
|
resolution = 72;
|
||||||
// TODO: use strokebounds for this:
|
// TODO: use strokebounds for this:
|
||||||
var bounds = this.bounds;
|
var bounds = this.bounds;
|
||||||
|
|
|
@ -164,7 +164,7 @@ Raster = Item.extend({
|
||||||
|
|
||||||
var xMin = coords[0], xMax = coords[0];
|
var xMin = coords[0], xMax = coords[0];
|
||||||
var yMin = coords[1], yMax = coords[1];
|
var yMin = coords[1], yMax = coords[1];
|
||||||
for(var i = 2; i < 8; i += 2) {
|
for (var i = 2; i < 8; i += 2) {
|
||||||
var x = coords[i];
|
var x = coords[i];
|
||||||
var y = coords[i + 1];
|
var y = coords[i + 1];
|
||||||
xMin = Math.min(x, xMin);
|
xMin = Math.min(x, xMin);
|
||||||
|
@ -184,11 +184,11 @@ Raster = Item.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
draw: function(ctx, param) {
|
draw: function(ctx, param) {
|
||||||
if(this.blendMode != 'normal' && !param.ignoreBlendMode) {
|
if (this.blendMode != 'normal' && !param.ignoreBlendMode) {
|
||||||
BlendMode.process(ctx, this, param);
|
BlendMode.process(ctx, this, param);
|
||||||
} else {
|
} else {
|
||||||
ctx.save();
|
ctx.save();
|
||||||
if(param.ignoreBlendMode !== true)
|
if (param.ignoreBlendMode !== true)
|
||||||
this.matrix.applyToContext(ctx);
|
this.matrix.applyToContext(ctx);
|
||||||
ctx.drawImage(this._canvas || this._image,
|
ctx.drawImage(this._canvas || this._image,
|
||||||
-this.size.width / 2, -this.size.height / 2);
|
-this.size.width / 2, -this.size.height / 2);
|
||||||
|
|
|
@ -20,10 +20,10 @@ CompoundPath = PathItem.extend(new function() {
|
||||||
},
|
},
|
||||||
|
|
||||||
draw: function(ctx, param) {
|
draw: function(ctx, param) {
|
||||||
if(!this.visible)
|
if (!this.visible)
|
||||||
return;
|
return;
|
||||||
if (this.children.length) {
|
if (this.children.length) {
|
||||||
if(this.blendMode != 'normal' && !param.ignoreBlendMode) {
|
if (this.blendMode != 'normal' && !param.ignoreBlendMode) {
|
||||||
BlendMode.process(ctx, this, param);
|
BlendMode.process(ctx, this, param);
|
||||||
} else {
|
} else {
|
||||||
var firstChild = this.children[0];
|
var firstChild = this.children[0];
|
||||||
|
|
|
@ -110,7 +110,7 @@ Path.inject({ statics: new function() {
|
||||||
var three = !(numSides % 3);
|
var three = !(numSides % 3);
|
||||||
var vector = new Point(0, three ? -radius : radius);
|
var vector = new Point(0, three ? -radius : radius);
|
||||||
var offset = three ? -1 : 0.5;
|
var offset = three ? -1 : 0.5;
|
||||||
for(var i = 0; i < numSides; i++) {
|
for (var i = 0; i < numSides; i++) {
|
||||||
var angle = (360 / numSides) * (i + offset);
|
var angle = (360 / numSides) * (i + offset);
|
||||||
path.add(center.add(vector.rotate(angle)));
|
path.add(center.add(vector.rotate(angle)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,11 +139,11 @@ Path = PathItem.extend({
|
||||||
throw new Error('Nesting capacity exceeded in Path#getLenght()');
|
throw new Error('Nesting capacity exceeded in Path#getLenght()');
|
||||||
// Multiply by 3 again, as derivative was divided by 3
|
// Multiply by 3 again, as derivative was divided by 3
|
||||||
var length = 3 * integral;
|
var length = 3 * integral;
|
||||||
if(goal == undefined || goal < 0 || goal >= length)
|
if (goal == undefined || goal < 0 || goal >= length)
|
||||||
return length;
|
return length;
|
||||||
var result = MathUtils.unsimpson(goal, ds, 0, goal / integral,
|
var result = MathUtils.unsimpson(goal, ds, 0, goal / integral,
|
||||||
100 * MathUtils.EPSILON, integral, Math.sqrt(MathUtils.EPSILON), 1);
|
100 * MathUtils.EPSILON, integral, Math.sqrt(MathUtils.EPSILON), 1);
|
||||||
if(!result)
|
if (!result)
|
||||||
throw new Error('Nesting capacity exceeded in computing arctime');
|
throw new Error('Nesting capacity exceeded in computing arctime');
|
||||||
return -result.b;
|
return -result.b;
|
||||||
},
|
},
|
||||||
|
@ -408,7 +408,7 @@ Path = PathItem.extend({
|
||||||
|
|
||||||
draw: function(ctx, param) {
|
draw: function(ctx, param) {
|
||||||
if (!this.visible) return;
|
if (!this.visible) return;
|
||||||
if(this.blendMode != 'normal' && !param.ignoreBlendMode) {
|
if (this.blendMode != 'normal' && !param.ignoreBlendMode) {
|
||||||
BlendMode.process(ctx, this, param);
|
BlendMode.process(ctx, this, param);
|
||||||
} else {
|
} else {
|
||||||
param.ignoreBlendMode = false;
|
param.ignoreBlendMode = false;
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
CanvasProvider = {
|
CanvasProvider = {
|
||||||
canvases: [],
|
canvases: [],
|
||||||
getCanvas: function(size) {
|
getCanvas: function(size) {
|
||||||
if(this.canvases.length) {
|
if (this.canvases.length) {
|
||||||
var canvas = this.canvases.pop();
|
var canvas = this.canvases.pop();
|
||||||
// If they are not the same size, we don't need to clear them
|
// If they are not the same size, we don't need to clear them
|
||||||
// using clearRect and visa versa.
|
// using clearRect and visa versa.
|
||||||
if((canvas.width != size.width) || (canvas.height != size.height)) {
|
if ((canvas.width != size.width) || (canvas.height != size.height)) {
|
||||||
canvas.width = size.width;
|
canvas.width = size.width;
|
||||||
canvas.height = size.height;
|
canvas.height = size.height;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue