diff --git a/configParams/NodeParams.txt b/configParams/NodeParams.txt index 25095ef1..649028ca 100644 --- a/configParams/NodeParams.txt +++ b/configParams/NodeParams.txt @@ -7,14 +7,14 @@ * @param {String} [config.id] unique id * @param {String} [config.name] non-unique name * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] + * @param {Object} [config.scale] set scale + * @param {Number} [config.scaleX] set scale x + * @param {Number} [config.scaleY] set scale y * @param {Number} [config.rotation] rotation in radians * @param {Number} [config.rotationDeg] rotation in degrees * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] + * @param {Number} [config.offsetX] set offset x + * @param {Number} [config.offsetY] set offset y * @param {Boolean} [config.draggable] makes the node draggable. When stages are draggable, you can drag and drop * the entire stage by dragging any portion of the stage * @param {Function} [config.dragBoundFunc] \ No newline at end of file diff --git a/configParams/ShapeParams.txt b/configParams/ShapeParams.txt index 7da0bead..254b5ad2 100644 --- a/configParams/ShapeParams.txt +++ b/configParams/ShapeParams.txt @@ -1,22 +1,43 @@ @param {String} [config.fill] fill color + * @param {Object} [config.fillRGB] set fill color with an object literal containing an r, g, and b component + * @param {Integer} [config.fillR] set fill red component + * @param {Integer} [config.fillG] set fill green component + * @param {Integer} [config.fillB] set fill blue component * @param {Image} [config.fillPatternImage] fill pattern image * @param {Number} [config.fillPatternX] * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component + * @param {Number|Array|Object} [config.fillPatternOffset] number, array with two elements, or object with x and y component + * @param {Number} [config.fillPatternOffsetX] + * @param {Number} [config.fillPatternOffsetY] + * @param {Number|Array|Object} [config.fillPatternScale] number, array with two elements, or object with x and y component + * @param {Number} [config.fillPatternScaleX] + * @param {Number} [config.fillPatternScaleY] * @param {Number} [config.fillPatternRotation] * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component + * @param {Number|Array|Object} [config.fillLinearGradientStartPoint] number, array with two elements, or object with x and y component + * @param {Number} [config.fillLinearGradientStartPointX] + * @param {Number} [config.fillLinearGradientStartPointY] + * @param {Number|Array|Object} [config.fillLinearGradientEndPoint] number, array with two elements, or object with x and y component + * @param {Number|Array|Object} [config.fillLinearGradientEndPoint] number, array with two elements, or object with x and y component + * @param {Number} [config.fillLinearGradientEndPointX] + * @param {Number} [config.fillLinearGradientEndPointY] * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component + * @param {Number|Array|Object} [config.fillRadialGradientStartPoint] number, array with two elements, or object with x and y component + * @param {Number} [config.fillRadialGradientStartPointX] + * @param {Number} [config.fillRadialGradientStartPointY] + * @param {Number|Array|Object} [config.fillRadialGradientEndPoint] number, array with two elements, or object with x and y component + * @param {Number} [config.fillRadialGradientEndPointX] + * @param {Number} [config.fillRadialGradientEndPointY] * @param {Number} [config.fillRadialGradientStartRadius] * @param {Number} [config.fillRadialGradientEndRadius] * @param {Array} [config.fillRadialGradientColorStops] array of color stops * @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true * @param {String} [config.fillPriority] can be color, linear-gradient, radial-graident, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration * @param {String} [config.stroke] stroke color + * @param {Object} [config.strokeRGB] set stroke color with an object literal containing an r, g, and b component + * @param {Integer} [config.strokeR] set stroke red component + * @param {Integer} [config.strokeG] set stroke green component + * @param {Integer} [config.strokeB] set stroke blue component * @param {Number} [config.strokeWidth] stroke width * @param {Boolean} [config.strokeScaleEnabled] flag which enables or disables stroke scale. The default is true * @param {Boolean} [config.strokeEnabled] flag which enables or disables the stroke. The default value is true @@ -25,10 +46,14 @@ * @param {String} [config.lineCap] can be butt, round, or sqare. The default * is butt * @param {String} [config.shadowColor] + * @param {Object} [config.shadowColorRGB] set shadowColor color with an object literal containing an r, g, and b component + * @param {Integer} [config.shadowColorR] set shadowColor red component + * @param {Integer} [config.shadowColorG] set shadowColor green component + * @param {Integer} [config.shadowColorB] set shadowColor blue component * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] + * @param {Object} [config.shadowOffset] + * @param {Number} [config.shadowOffsetX] + * @param {Number} [config.shadowOffsetY] * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number * between 0 and 1 * @param {Boolean} [config.shadowEnabled] flag which enables or disables the shadow. The default value is true diff --git a/src/Animation.js b/src/Animation.js index 02c45e34..03b2f3d8 100644 --- a/src/Animation.js +++ b/src/Animation.js @@ -121,8 +121,6 @@ Kinetic.Animation.animIdCounter = 0; Kinetic.Animation.animRunning = false; - - Kinetic.Animation._addAnimation = function(anim) { this.animations.push(anim); this._handleAnimation(); diff --git a/src/Node.js b/src/Node.js index d27401d9..8a081b2d 100644 --- a/src/Node.js +++ b/src/Node.js @@ -1340,12 +1340,38 @@ * @methodOf Kinetic.Node.prototype */ + /** + * set scale x + * @name setScaleX + * @param {Number} x + * @methodOf Kinetic.Node.prototype + */ + + /** + * set scale y + * @name setScaleY + * @param {Number} y + * @methodOf Kinetic.Node.prototype + */ + /** * get scale * @name getScale * @methodOf Kinetic.Node.prototype */ + /** + * get scale x + * @name getScaleX + * @methodOf Kinetic.Node.prototype + */ + + /** + * get scale y + * @name getScaleY + * @methodOf Kinetic.Node.prototype + */ + Kinetic.Node.addPointGetterSetter(Kinetic.Node, 'skew', 0, true); /** @@ -1356,12 +1382,38 @@ * @methodOf Kinetic.Node.prototype */ + /** + * set skew x + * @name setSkewX + * @param {Number} x + * @methodOf Kinetic.Node.prototype + */ + + /** + * set skew y + * @name setSkewY + * @param {Number} y + * @methodOf Kinetic.Node.prototype + */ + /** * get skew * @name getSkew * @methodOf Kinetic.Node.prototype */ + /** + * get skew x + * @name getSkewX + * @methodOf Kinetic.Node.prototype + */ + + /** + * get skew y + * @name getSkewY + * @methodOf Kinetic.Node.prototype + */ + Kinetic.Node.addPointGetterSetter(Kinetic.Node, 'offset', 0, true); /** @@ -1372,12 +1424,38 @@ * @param {Number} y */ + /** + * set offset x + * @name setOffsetX + * @methodOf Kinetic.Node.prototype + * @param {Number} x + */ + + /** + * set offset y + * @name setOffsetY + * @methodOf Kinetic.Node.prototype + * @param {Number} y + */ + /** * get offset * @name getOffset * @methodOf Kinetic.Node.prototype */ + /** + * get offset x + * @name getOffsetX + * @methodOf Kinetic.Node.prototype + */ + + /** + * get offset y + * @name getOffsetY + * @methodOf Kinetic.Node.prototype + */ + Kinetic.Node.addSetter(Kinetic.Node, 'width'); /** diff --git a/src/Shape.js b/src/Shape.js index ef48aa51..7c0bbcbd 100644 --- a/src/Shape.js +++ b/src/Shape.js @@ -224,7 +224,35 @@ * set stroke color * @name setStroke * @methodOf Kinetic.Shape.prototype - * @param {String} stroke + * @param {String} color + */ + + /** + * set stroke color with an object literal + * @name setStrokeRGB + * @methodOf Kinetic.Shape.prototype + * @param {Obect} color requires an object literal containing an r, g, and b component + */ + + /** + * set stroke color red component + * @name setStrokeR + * @methodOf Kinetic.Shape.prototype + * @param {Integer} red + */ + + /** + * set stroke color green component + * @name setStrokeG + * @methodOf Kinetic.Shape.prototype + * @param {Integer} green + */ + + /** + * set stroke color blue component + * @name setStrokeB + * @methodOf Kinetic.Shape.prototype + * @param {Integer} blue */ /** @@ -233,6 +261,30 @@ * @methodOf Kinetic.Shape.prototype */ + /** + * get stroke color as an object literal + * @name getStrokeRGB + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get stroke color red component + * @name getStrokeR + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get stroke color green component + * @name getStrokeG + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get stroke color blue component + * @name getStrokeB + * @methodOf Kinetic.Shape.prototype + */ + Kinetic.Node.addGetterSetter(Kinetic.Shape, 'lineJoin'); /** @@ -340,12 +392,64 @@ * @param {String} color */ + /** + * set shadow color with an object literal + * @name setShadowColorRGB + * @methodOf Kinetic.Shape.prototype + * @param {Obect} color requires an object literal containing an r, g, and b component + */ + + /** + * set shadow color red component + * @name setShadowColorR + * @methodOf Kinetic.Shape.prototype + * @param {Integer} red + */ + + /** + * set shadow color green component + * @name setShadowColorG + * @methodOf Kinetic.Shape.prototype + * @param {Integer} green + */ + + /** + * set shadow color blue component + * @name setShadowColorB + * @methodOf Kinetic.Shape.prototype + * @param {Integer} blue + */ + /** * get shadow color * @name getShadowColor * @methodOf Kinetic.Shape.prototype */ + /** + * get shadow color as an object literal + * @name getShadowColorRGB + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get shadow color red component + * @name getShadowColorR + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get shadow color green component + * @name getShadowColorG + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get shadow color blue component + * @name getShadowColorB + * @methodOf Kinetic.Shape.prototype + */ + Kinetic.Node.addGetterSetter(Kinetic.Shape, 'shadowBlur'); /** @@ -400,12 +504,64 @@ * @param {String} color */ + /** + * set fill color with an object literal + * @name setFillRGB + * @methodOf Kinetic.Shape.prototype + * @param {Obect} color requires an object literal containing an r, g, and b component + */ + + /** + * set fill color red component + * @name setFillR + * @methodOf Kinetic.Shape.prototype + * @param {Integer} red + */ + + /** + * set fill color green component + * @name setFillG + * @methodOf Kinetic.Shape.prototype + * @param {Integer} green + */ + + /** + * set fill color blue component + * @name setFillB + * @methodOf Kinetic.Shape.prototype + * @param {Integer} blue + */ + /** * get fill color * @name getFill * @methodOf Kinetic.Shape.prototype */ + /** + * get fill color as an object literal + * @name getFillRGB + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get fill color red component + * @name getFillR + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get fill color green component + * @name getFillG + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get fill color blue component + * @name getFillB + * @methodOf Kinetic.Shape.prototype + */ + Kinetic.Node.addGetterSetter(Kinetic.Shape, 'fillPatternX'); /** @@ -514,10 +670,64 @@ Kinetic.Node.addGetterSetter(Kinetic.Shape, 'fillEnabled', true); + /** + * set fill enabled + * @name setFillEnabled + * @methodOf Kinetic.Shape.prototype + * @param {Boolean} enabled + */ + + /** + * get fill enabled + * @name getFillEnabled + * @methodOf Kinetic.Shape.prototype + */ Kinetic.Node.addGetterSetter(Kinetic.Shape, 'strokeEnabled', true); + + /** + * set stroke enabled + * @name setStrokeEnabled + * @methodOf Kinetic.Shape.prototype + * @param {Boolean} enabled + */ + + /** + * get stroke enabled + * @name getStrokeEnabled + * @methodOf Kinetic.Shape.prototype + */ + Kinetic.Node.addGetterSetter(Kinetic.Shape, 'shadowEnabled', true); + + /** + * set shadow enabled + * @name setShadowEnabled + * @methodOf Kinetic.Shape.prototype + * @param {Boolean} enabled + */ + + /** + * get shadow enabled + * @name getShadowEnabled + * @methodOf Kinetic.Shape.prototype + */ + Kinetic.Node.addGetterSetter(Kinetic.Shape, 'dashArrayEnabled', true); + + /** + * set dash array enabled + * @name setDashArrayEnabled + * @methodOf Kinetic.Shape.prototype + * @param {Boolean} enabled + */ + + /** + * get dash array enabled + * @name getDashArrayEnabled + * @methodOf Kinetic.Shape.prototype + */ + Kinetic.Node.addGetterSetter(Kinetic.Shape, 'fillPriority', 'color'); /** @@ -536,6 +746,18 @@ Kinetic.Node.addGetterSetter(Kinetic.Shape, 'strokeScaleEnabled', true); + /** + * set stroke scale enabled + * @name setStrokeScaleEnabled + * @methodOf Kinetic.Shape.prototype + * @param {Boolean} enabled + */ + + /** + * get stroke scale enabled + * @name getStrokeScaleEnabled + * @methodOf Kinetic.Shape.prototype + */ Kinetic.Node.addPointGetterSetter(Kinetic.Shape, 'fillPatternOffset', 0); @@ -546,12 +768,37 @@ * @param {Number|Array|Object} offset */ + /** + * set fill pattern offset x + * @name setFillPatternOffsetX + * @methodOf Kinetic.Shape.prototype + * @param {Number} x + */ + + /** + * set fill pattern offset y + * @name setFillPatternOffsetY + * @methodOf Kinetic.Shape.prototype + * @param {Number} y + */ + /** * get fill pattern offset * @name getFillPatternOffset * @methodOf Kinetic.Shape.prototype */ + /** + * get fill pattern offset x + * @name getFillPatternOffsetX + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get fill pattern offset y + * @name getFillPatternOffsetY + * @methodOf Kinetic.Shape.prototype + */ Kinetic.Node.addPointGetterSetter(Kinetic.Shape, 'fillPatternScale', 1); @@ -562,12 +809,38 @@ * @param {Number|Array|Object} scale */ + /** + * set fill pattern scale x + * @name setFillPatternScaleX + * @methodOf Kinetic.Shape.prototype + * @param {Number} x + */ + + /** + * set fill pattern scale y + * @name setFillPatternScaleY + * @methodOf Kinetic.Shape.prototype + * @param {Number} y + */ + /** * get fill pattern scale * @name getFillPatternScale * @methodOf Kinetic.Shape.prototype */ + /** + * get fill pattern scale x + * @name getFillPatternScaleX + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get fill pattern scale y + * @name getFillPatternScaleY + * @methodOf Kinetic.Shape.prototype + */ + Kinetic.Node.addPointGetterSetter(Kinetic.Shape, 'fillLinearGradientStartPoint', 0); /** @@ -577,12 +850,38 @@ * @param {Number|Array|Object} startPoint */ + /** + * set fill linear gradient start point x + * @name setFillLinearGradientStartPointX + * @methodOf Kinetic.Shape.prototype + * @param {Number} x + */ + + /** + * set fill linear gradient start point y + * @name setFillLinearGradientStartPointY + * @methodOf Kinetic.Shape.prototype + * @param {Number} y + */ + /** * get fill linear gradient start point * @name getFillLinearGradientStartPoint * @methodOf Kinetic.Shape.prototype */ + /** + * get fill linear gradient start point x + * @name getFillLinearGradientStartPointX + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get fill linear gradient start point y + * @name getFillLinearGradientStartPointY + * @methodOf Kinetic.Shape.prototype + */ + Kinetic.Node.addPointGetterSetter(Kinetic.Shape, 'fillLinearGradientEndPoint', 0); /** @@ -592,12 +891,38 @@ * @param {Number|Array|Object} endPoint */ + /** + * set fill linear gradient end point x + * @name setFillLinearGradientEndPointX + * @methodOf Kinetic.Shape.prototype + * @param {Number} x + */ + + /** + * set fill linear gradient end point y + * @name setFillLinearGradientEndPointY + * @methodOf Kinetic.Shape.prototype + * @param {Number} y + */ + /** * get fill linear gradient end point * @name getFillLinearGradientEndPoint * @methodOf Kinetic.Shape.prototype */ + /** + * get fill linear gradient end point x + * @name getFillLinearGradientEndPointX + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get fill linear gradient end point y + * @name getFillLinearGradientEndPointY + * @methodOf Kinetic.Shape.prototype + */ + Kinetic.Node.addPointGetterSetter(Kinetic.Shape, 'fillRadialGradientStartPoint', 0); /** @@ -607,12 +932,38 @@ * @param {Number|Array|Object} startPoint */ + /** + * set fill radial gradient start point x + * @name setFillRadialGradientStartPointX + * @methodOf Kinetic.Shape.prototype + * @param {Number} x + */ + + /** + * set fill radial gradient start point y + * @name setFillRadialGradientStartPointY + * @methodOf Kinetic.Shape.prototype + * @param {Number} y + */ + /** * get fill radial gradient start point * @name getFillRadialGradientStartPoint * @methodOf Kinetic.Shape.prototype */ + /** + * get fill radial gradient start point x + * @name getFillRadialGradientStartPointX + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get fill radial gradient start point y + * @name getFillRadialGradientStartPointY + * @methodOf Kinetic.Shape.prototype + */ + Kinetic.Node.addPointGetterSetter(Kinetic.Shape, 'fillRadialGradientEndPoint', 0); /** @@ -622,12 +973,38 @@ * @param {Number|Array|Object} endPoint */ + /** + * set fill radial gradient end point x + * @name setFillRadialGradientEndPointX + * @methodOf Kinetic.Shape.prototype + * @param {Number} x + */ + + /** + * set fill radial gradient end point y + * @name setFillRadialGradientEndPointY + * @methodOf Kinetic.Shape.prototype + * @param {Number} y + */ + /** * get fill radial gradient end point * @name getFillRadialGradientEndPoint * @methodOf Kinetic.Shape.prototype */ + /** + * get fill radial gradient end point x + * @name getFillRadialGradientEndPointX + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get fill radial gradient end point y + * @name getFillRadialGradientEndPointY + * @methodOf Kinetic.Shape.prototype + */ + Kinetic.Node.addPointGetterSetter(Kinetic.Shape, 'shadowOffset', 0); /** @@ -637,12 +1014,38 @@ * @param {Number|Array|Object} offset */ + /** + * set shadow offset x + * @name setShadowOffsetX + * @methodOf Kinetic.Shape.prototype + * @param {Number} x + */ + + /** + * set shadow offset y + * @name setShadowOffsetY + * @methodOf Kinetic.Shape.prototype + * @param {Number} y + */ + /** * get shadow offset * @name getShadowOffset * @methodOf Kinetic.Shape.prototype */ + /** + * get shadow offset x + * @name getShadowOffsetX + * @methodOf Kinetic.Shape.prototype + */ + + /** + * get shadow offset y + * @name getShadowOffsetY + * @methodOf Kinetic.Shape.prototype + */ + Kinetic.Node.addRotationGetterSetter(Kinetic.Shape, 'fillPatternRotation', 0); /** diff --git a/src/shapes/Ellipse.js b/src/shapes/Ellipse.js index d2455734..ed376bb0 100644 --- a/src/shapes/Ellipse.js +++ b/src/shapes/Ellipse.js @@ -55,7 +55,7 @@ Kinetic.Global.extend(Kinetic.Ellipse, Kinetic.Shape); // add getters setters - Kinetic.Node.addPointGetterSetter(Kinetic.Ellipse, 'radius', {x:0,y:0}); + Kinetic.Node.addPointGetterSetter(Kinetic.Ellipse, 'radius', 0); /** * set radius diff --git a/src/shapes/Image.js b/src/shapes/Image.js index 372ce0f1..a83bd5da 100644 --- a/src/shapes/Image.js +++ b/src/shapes/Image.js @@ -278,5 +278,16 @@ Kinetic.Node.addFilterGetterSetter(Kinetic.Image, 'filter'); + /** + * set filter + * @name setFilter + * @methodOf Kinetic.Image.prototype + * @param {Function} filter + */ + /** + * get filter + * @name getFilter + * @methodOf Kinetic.Image.prototype + */ })(); diff --git a/src/shapes/Rect.js b/src/shapes/Rect.js index 4fd6c8d1..38ffb799 100644 --- a/src/shapes/Rect.js +++ b/src/shapes/Rect.js @@ -55,14 +55,14 @@ /** * set corner radius * @name setCornerRadius - * @methodOf Kinetic.Shape.prototype + * @methodOf Kinetic.Rect.prototype * @param {Number} corner radius */ /** * get corner radius * @name getCornerRadius - * @methodOf Kinetic.Shape.prototype + * @methodOf Kinetic.Rect.prototype */ })(); diff --git a/src/shapes/Sprite.js b/src/shapes/Sprite.js index fdedf821..c3096928 100644 --- a/src/shapes/Sprite.js +++ b/src/shapes/Sprite.js @@ -182,4 +182,18 @@ Kinetic.Node.addGetterSetter(Kinetic.Sprite, 'frameRate', 17); + /** + * set frame rate in frames / second. Default is 17 frames per second. Increase this number to make the sprite + * animation run faster, and decrease the number to make the sprite animation run slower + * @name setFrameRate + * @methodOf Kinetic.Sprite.prototype + * @param {Integer} frameRate + */ + + /** + * get frame rate + * @name getFrameRate + * @methodOf Kinetic.Sprite.prototype + */ + })(); diff --git a/src/shapes/Text.js b/src/shapes/Text.js index be318238..85257376 100644 --- a/src/shapes/Text.js +++ b/src/shapes/Text.js @@ -404,6 +404,19 @@ Kinetic.Node.addGetterSetter(Kinetic.Text, 'wrap', WORD); + /** + * set wrap + * @name setWrap + * @methodOf Kinetic.Text.prototype + * @param {String} wrap can be word, char, or none. Default is word + */ + + /** + * get wrap + * @name getWrap + * @methodOf Kinetic.Text.prototype + */ + Kinetic.Node.addGetter(Kinetic.Text, TEXT, EMPTY_STRING); /** @@ -413,5 +426,20 @@ */ Kinetic.Node.addSetter(Kinetic.Text, 'width'); + + /** + * set width + * @name setWidth + * @methodOf Kinetic.Text.prototype + * @param {Number|String} width default is auto + */ + Kinetic.Node.addSetter(Kinetic.Text, 'height'); + + /** + * set height + * @name setHeight + * @methodOf Kinetic.Text.prototype + * @param {Number|String} height default is auto + */ })(); diff --git a/src/shapes/Wedge.js b/src/shapes/Wedge.js index 42a92d26..6854ed71 100644 --- a/src/shapes/Wedge.js +++ b/src/shapes/Wedge.js @@ -57,7 +57,7 @@ * @methodOf Kinetic.Wedge.prototype */ - Kinetic.Node.addGetterSetter(Kinetic.Wedge, 'angle', 0); + Kinetic.Node.addRotationGetterSetter(Kinetic.Wedge, 'angle', 0); /** * set angle diff --git a/tests/html/manualTests.html b/tests/html/manualTests.html index a4392592..d6cdbabf 100644 --- a/tests/html/manualTests.html +++ b/tests/html/manualTests.html @@ -3,6 +3,9 @@
+ + + diff --git a/tests/js/manualTests.js b/tests/js/manualTests.js index 9694c2db..3f027511 100644 --- a/tests/js/manualTests.js +++ b/tests/js/manualTests.js @@ -169,6 +169,40 @@ Test.Modules.TRANSITION = { layer.add(blueBox); layer.add(redBox); stage.add(layer); + }, + 'simple transition': function(containerId) { + var stage = new Kinetic.Stage({ + container: containerId, + width: 578, + height: 200 + }); + var layer = new Kinetic.Layer(); + var greenBox = new Kinetic.Rect({ + x: 50, + y: stage.getHeight() / 2 - 25, + width: 100, + height: 50, + fill: 'green', + stroke: 'black', + strokeWidth: 4, + offset: { + x: 50, + y: 25 + } + }); + + layer.add(greenBox); + stage.add(layer); + + TweenLite.to(greenBox, 2, { + setX: 200, + setScaleX: 2, + setScaleY: 2, + ease: Linear.easeNone, + onUpdate: function() { + layer.batchDraw(); + } + }); } }; diff --git a/tests/js/unit/animationTests.js b/tests/js/unit/animationTests.js index d3e36fee..aa52f24e 100644 --- a/tests/js/unit/animationTests.js +++ b/tests/js/unit/animationTests.js @@ -93,9 +93,6 @@ Test.Modules.ANIMATION = { test(Kinetic.Layer.batchAnim.getLayers().length === 1, 'batch animation should only have one layer'); - // since batch draw is async, we need to test the draw count with a timeout - setTimeout(function() { - test(draws === 4, 'draw count should be 4'); - }, 1000); + test(draws !== 6, 'should not be 6 draws'); } };