Skip to content

Commit

Permalink
fixed pattern scale default issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ericdrowell committed Jan 13, 2014
1 parent 8dd503c commit 79f86f2
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@
*/


Kinetic.Factory.addGetterSetter(Kinetic.Shape, 'fillPatternScaleX', 0);
Kinetic.Factory.addGetterSetter(Kinetic.Shape, 'fillPatternScaleX', 1);
/**
* get/set fill pattern scale x
* @name fillPatternScaleX
Expand All @@ -1157,7 +1157,7 @@
* shape.fillPatternScaleX(2);
*/

Kinetic.Factory.addGetterSetter(Kinetic.Shape, 'fillPatternScaleY', 0);
Kinetic.Factory.addGetterSetter(Kinetic.Shape, 'fillPatternScaleY', 1);
/**
* get/set fill pattern scale y
* @name fillPatternScaleY
Expand Down
41 changes: 41 additions & 0 deletions test/unit/Shape-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,4 +575,45 @@ suite('Shape', function() {
assert.notEqual(Kinetic.Shape.prototype.getDashArray, undefined);
});

test('test defaults', function() {
var shape = new Kinetic.Shape();

assert.equal(shape.strokeRed(), 0);
assert.equal(shape.strokeGreen(), 0);
assert.equal(shape.strokeBlue(), 0);
assert.equal(shape.strokeWidth(), 2);
assert.equal(shape.shadowRed(), 0);
assert.equal(shape.shadowGreen(), 0);
assert.equal(shape.shadowBlue(), 0);
assert.equal(shape.shadowOffsetX(), 0);
assert.equal(shape.shadowOffsetY(), 0);
assert.equal(shape.fillRed(), 0);
assert.equal(shape.fillGreen(), 0);
assert.equal(shape.fillBlue(), 0);
assert.equal(shape.fillPatternX(), 0);
assert.equal(shape.fillPatternY(), 0);
assert.equal(shape.fillRadialGradientStartRadius(), 0);
assert.equal(shape.fillRadialGradientEndRadius(), 0);
assert.equal(shape.fillPatternRepeat(), 'repeat');
assert.equal(shape.fillEnabled(), true);
assert.equal(shape.strokeEnabled(), true);
assert.equal(shape.shadowEnabled(), true);
assert.equal(shape.dashEnabled(), true);
assert.equal(shape.strokeScaleEnabled(), true);
assert.equal(shape.fillPriority(), 'color');
assert.equal(shape.fillPatternOffsetX(), 0);
assert.equal(shape.fillPatternOffsetY(), 0);
assert.equal(shape.fillPatternScaleX(), 1);
assert.equal(shape.fillPatternScaleY(), 1);
assert.equal(shape.fillLinearGradientStartPointX(), 0);
assert.equal(shape.fillLinearGradientStartPointY(), 0);
assert.equal(shape.fillLinearGradientEndPointX(), 0);
assert.equal(shape.fillLinearGradientEndPointY(), 0);
assert.equal(shape.fillRadialGradientStartPointX(), 0);
assert.equal(shape.fillRadialGradientStartPointY(), 0);
assert.equal(shape.fillRadialGradientEndPointX(), 0);
assert.equal(shape.fillRadialGradientEndPointY(), 0);
assert.equal(shape.fillPatternRotation(), 0);
});

});

0 comments on commit 79f86f2

Please sign in to comment.