From 74f797a9dd0c0acf7d1fe2d0ddd9c2cc0d49c94a Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Mon, 28 Feb 2011 18:30:08 +0100 Subject: [PATCH] Clean up whitespace. --- src/item/Item.js | 4 ++-- src/item/Raster.js | 6 +++--- src/path/CompoundPath.js | 4 ++-- src/path/Path.Constructors.js | 2 +- src/path/Path.js | 6 +++--- src/util/CanvasProvider.js | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/item/Item.js b/src/item/Item.js index ad1545ef..336f7c63 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -478,7 +478,7 @@ Item = Base.extend({ while(parent) { // Find group parents. Check for parent.parent, since don't want // top level layers, because they also inherit from Group - if(parent.parent + if (parent.parent && (parent instanceof Group || parent instanceof CompoundPath) && item.isDescendant(parent)) return true; @@ -538,7 +538,7 @@ Item = Base.extend({ // weird results on Scriptographer. Also we can't use antialiasing, since // Canvas doesn't support it yet. Document colorMode is also out of the // question for now. - if(!resolution) + if (!resolution) resolution = 72; // TODO: use strokebounds for this: var bounds = this.bounds; diff --git a/src/item/Raster.js b/src/item/Raster.js index 78c84bd1..80211bd0 100644 --- a/src/item/Raster.js +++ b/src/item/Raster.js @@ -164,7 +164,7 @@ Raster = Item.extend({ var xMin = coords[0], xMax = coords[0]; 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 y = coords[i + 1]; xMin = Math.min(x, xMin); @@ -184,11 +184,11 @@ Raster = Item.extend({ }, draw: function(ctx, param) { - if(this.blendMode != 'normal' && !param.ignoreBlendMode) { + if (this.blendMode != 'normal' && !param.ignoreBlendMode) { BlendMode.process(ctx, this, param); } else { ctx.save(); - if(param.ignoreBlendMode !== true) + if (param.ignoreBlendMode !== true) this.matrix.applyToContext(ctx); ctx.drawImage(this._canvas || this._image, -this.size.width / 2, -this.size.height / 2); diff --git a/src/path/CompoundPath.js b/src/path/CompoundPath.js index 1833e942..43e24063 100644 --- a/src/path/CompoundPath.js +++ b/src/path/CompoundPath.js @@ -20,10 +20,10 @@ CompoundPath = PathItem.extend(new function() { }, draw: function(ctx, param) { - if(!this.visible) + if (!this.visible) return; if (this.children.length) { - if(this.blendMode != 'normal' && !param.ignoreBlendMode) { + if (this.blendMode != 'normal' && !param.ignoreBlendMode) { BlendMode.process(ctx, this, param); } else { var firstChild = this.children[0]; diff --git a/src/path/Path.Constructors.js b/src/path/Path.Constructors.js index 44b543fc..05532baa 100644 --- a/src/path/Path.Constructors.js +++ b/src/path/Path.Constructors.js @@ -110,7 +110,7 @@ Path.inject({ statics: new function() { var three = !(numSides % 3); var vector = new Point(0, three ? -radius : radius); 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); path.add(center.add(vector.rotate(angle))); } diff --git a/src/path/Path.js b/src/path/Path.js index 52ca16a8..bbb6fa6c 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -139,11 +139,11 @@ Path = PathItem.extend({ throw new Error('Nesting capacity exceeded in Path#getLenght()'); // Multiply by 3 again, as derivative was divided by 3 var length = 3 * integral; - if(goal == undefined || goal < 0 || goal >= length) + if (goal == undefined || goal < 0 || goal >= length) return length; var result = MathUtils.unsimpson(goal, ds, 0, goal / integral, 100 * MathUtils.EPSILON, integral, Math.sqrt(MathUtils.EPSILON), 1); - if(!result) + if (!result) throw new Error('Nesting capacity exceeded in computing arctime'); return -result.b; }, @@ -408,7 +408,7 @@ Path = PathItem.extend({ draw: function(ctx, param) { if (!this.visible) return; - if(this.blendMode != 'normal' && !param.ignoreBlendMode) { + if (this.blendMode != 'normal' && !param.ignoreBlendMode) { BlendMode.process(ctx, this, param); } else { param.ignoreBlendMode = false; diff --git a/src/util/CanvasProvider.js b/src/util/CanvasProvider.js index 0622bfbd..37e0e655 100644 --- a/src/util/CanvasProvider.js +++ b/src/util/CanvasProvider.js @@ -6,11 +6,11 @@ CanvasProvider = { canvases: [], getCanvas: function(size) { - if(this.canvases.length) { + if (this.canvases.length) { var canvas = this.canvases.pop(); // If they are not the same size, we don't need to clear them // 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.height = size.height; } else {