removed shape enablers and disables. They were reduandant methods and muddied up the API

This commit is contained in:
Eric Rowell 2014-01-05 21:03:11 -08:00
parent 2e97e20436
commit ceddf561fc
2 changed files with 9 additions and 109 deletions

View File

@ -124,106 +124,6 @@
p = bufferHitCanvas.context.getImageData(pos.x | 0, pos.y | 0, 1, 1).data;
return p[3] > 0;
},
/**
* enable fill
* @method
* @memberof Kinetic.Shape.prototype
* @returns {Kineitc.Shape}
*/
enableFill: function() {
this._setAttr('fillEnabled', true);
return this;
},
/**
* disable fill
* @method
* @memberof Kinetic.Shape.prototype
* @returns {Kineitc.Shape}
*/
disableFill: function() {
this._setAttr('fillEnabled', false);
return this;
},
/**
* enable stroke
* @method
* @memberof Kinetic.Shape.prototype
* @returns {Kineitc.Shape}
*/
enableStroke: function() {
this._setAttr('strokeEnabled', true);
return this;
},
/**
* disable stroke
* @method
* @memberof Kinetic.Shape.prototype
* @returns {Kineitc.Shape}
*/
disableStroke: function() {
this._setAttr('strokeEnabled', false);
return this;
},
/**
* enable stroke scale
* @method
* @memberof Kinetic.Shape.prototype
* @returns {Kineitc.Shape}
*/
enableStrokeScale: function() {
this._setAttr('strokeScaleEnabled', true);
return this;
},
/**
* disable stroke scale
* @method
* @memberof Kinetic.Shape.prototype
* @returns {Kineitc.Shape}
*/
disableStrokeScale: function() {
this._setAttr('strokeScaleEnabled', false);
return this;
},
/**
* enable shadow
* @method
* @memberof Kinetic.Shape.prototype
* @returns {Kineitc.Shape}
*/
enableShadow: function() {
this._setAttr('shadowEnabled', true);
return this;
},
/**
* disable shadow
* @method
* @memberof Kinetic.Shape.prototype
* @returns {Kineitc.Shape}
*/
disableShadow: function() {
this._setAttr('shadowEnabled', false);
return this;
},
/**
* enable dash array
* @method
* @memberof Kinetic.Shape.prototype
* @returns {Kineitc.Shape}
*/
enableDashArray: function() {
this._setAttr('dashArrayEnabled', true);
return this;
},
/**
* disable dash array
* @method
* @memberof Kinetic.Shape.prototype
* @returns {Kineitc.Shape}
*/
disableDashArray: function() {
this._setAttr('dashArrayEnabled', false);
return this;
},
// extends Node.prototype.destroy
destroy: function() {
Kinetic.Node.prototype.destroy.call(this);

View File

@ -351,7 +351,7 @@ suite('Shape', function() {
assert.equal(circle.getShadowEnabled(), true, 'shadowEnabled should be true');
assert.equal(circle.getDashArrayEnabled(), true, 'dashArrayEnabled should be true');
circle.disableStrokeScale();
circle.strokeScaleEnabled(false);
assert.equal(circle.getStrokeScaleEnabled(), false);
layer.draw();
@ -359,31 +359,31 @@ suite('Shape', function() {
//console.log(trace);
assert.equal(trace, 'clearRect(0,0,578,200);save();save();shadowColor=black;shadowBlur=10;shadowOffsetX=10;shadowOffsetY=10;drawImage([object HTMLCanvasElement],0,0);restore();drawImage([object HTMLCanvasElement],0,0);restore();clearRect(0,0,578,200);save();save();shadowColor=black;shadowBlur=10;shadowOffsetX=10;shadowOffsetY=10;drawImage([object HTMLCanvasElement],0,0);restore();drawImage([object HTMLCanvasElement],0,0);restore();');
circle.disableFill();
circle.fillEnabled(false);
assert.equal(circle.getFillEnabled(), false, 'fillEnabled should be false');
circle.disableStroke();
circle.strokeEnabled(false);
assert.equal(circle.getStrokeEnabled(), false, 'strokeEnabled should be false');
circle.disableShadow();
circle.shadowEnabled(false);
assert.equal(circle.getShadowEnabled(), false, 'shadowEnabled should be false');
circle.disableDashArray();
circle.dashArrayEnabled(false);
assert.equal(circle.getDashArrayEnabled(), false, 'dashArrayEnabled should be false');
// re-enable
circle.enableDashArray();
circle.dashArrayEnabled(true);
assert.equal(circle.getDashArrayEnabled(), true, 'dashArrayEnabled should be true');
circle.enableShadow();
circle.shadowEnabled(true);
assert.equal(circle.getShadowEnabled(), true, 'shadowEnabled should be true');
circle.enableStroke();
circle.strokeEnabled(true);
assert.equal(circle.getStrokeEnabled(), true, 'strokeEnabled should be true');
circle.enableFill();
circle.fillEnabled(true);
assert.equal(circle.getFillEnabled(), true, 'fillEnabled should be true');
});