minor code cleanup discovered by Wappworks

This commit is contained in:
Eric Rowell
2012-03-11 23:01:23 -07:00
parent 24158587e6
commit 68db5bf7c1
8 changed files with 26 additions and 26 deletions

View File

@@ -307,7 +307,7 @@ Kinetic.Node.prototype = {
},
/**
* set zIndex
* @param {int} index
* @param {int} zIndex
*/
setZIndex: function(zIndex) {
var index = this.index;
@@ -405,7 +405,7 @@ Kinetic.Node.prototype = {
},
/**
* move node to another container
* @param {Layer} newLayer
* @param {Container} newContainer
*/
moveTo: function(newContainer) {
var parent = this.parent;
@@ -522,4 +522,4 @@ Kinetic.Node.prototype = {
*/
handle(this);
}
};
};

View File

@@ -31,11 +31,11 @@ Kinetic.Shape = function(config) {
*/
Kinetic.Shape.prototype = {
/**
* get layer context where the shape is being drawn. When
* the shape is being rendered, .getContext() returns the context of the
* user created layer that contains the shape. When the event detection
* engine is determining whether or not an event has occured on that shape,
* .getContext() returns the context of the invisible backstage layer.
* get layer context where the shape is being drawn. When
* the shape is being rendered, .getContext() returns the context of the
* user created layer that contains the shape. When the event detection
* engine is determining whether or not an event has occured on that shape,
* .getContext() returns the context of the invisible backstage layer.
*/
getContext: function() {
return this.tempLayer.getContext();

View File

@@ -42,7 +42,7 @@ Kinetic.Image.prototype = {
/**
* get image
*/
getImage: function(image) {
getImage: function() {
return this.image;
},
/**
@@ -82,4 +82,4 @@ Kinetic.Image.prototype = {
}
};
// extend Shape
Kinetic.GlobalObject.extend(Kinetic.Image, Kinetic.Shape);
Kinetic.GlobalObject.extend(Kinetic.Image, Kinetic.Shape);

View File

@@ -9,7 +9,6 @@
*/
Kinetic.Rect = function(config) {
config.drawFunc = function() {
var canvas = this.getCanvas();
var context = this.getContext();
context.beginPath();
context.rect(0, 0, this.width, this.height);
@@ -61,4 +60,4 @@ Kinetic.Rect.prototype = {
};
// extend Shape
Kinetic.GlobalObject.extend(Kinetic.Rect, Kinetic.Shape);
Kinetic.GlobalObject.extend(Kinetic.Rect, Kinetic.Shape);

View File

@@ -29,7 +29,6 @@ Kinetic.Text = function(config) {
}
config.drawFunc = function() {
var canvas = this.getCanvas();
var context = this.getContext();
context.font = this.fontSize + "pt " + this.fontFamily;
context.textBaseline = "middle";
@@ -212,4 +211,4 @@ Kinetic.Text.prototype = {
}
};
// extend Shape
Kinetic.GlobalObject.extend(Kinetic.Text, Kinetic.Shape);
Kinetic.GlobalObject.extend(Kinetic.Text, Kinetic.Shape);