Merge pull request #827 from Kienz/patch-1

Rename `fabric.Shadow.getShadow` to `fabric.Shadow.toString`
This commit is contained in:
Juriy Zaytsev 2013-09-05 09:18:59 -07:00
commit 03a7326ef8
3 changed files with 7 additions and 6 deletions

View file

@ -86,10 +86,11 @@
},
/**
* @return {String} Returns CSS3 text-shadow declaration
* Returns a string representation of an instance
* @see http://www.w3.org/TR/css-text-decor-3/#text-shadow
* @return {String} Returns CSS3 text-shadow declaration
*/
getShadow: function() {
toString: function() {
return [this.offsetX, this.offsetY, this.blur, this.color].join('px ');
},

View file

@ -25,7 +25,7 @@ fabric.util.object.extend(fabric.Text.prototype, {
fontFamily: this.fontFamily,
fontWeight: this.fontWeight,
textDecoration: this.textDecoration,
textShadow: this.shadow && this.shadow.getShadow(),
textShadow: this.shadow && this.shadow.toString(),
textAlign: this.textAlign,
fontStyle: this.fontStyle,
lineHeight: this.lineHeight,

View file

@ -120,11 +120,11 @@
equal(shadow.offsetY, 0);
});
test('getShadow', function() {
test('toString', function() {
var shadow = new fabric.Shadow();
ok(typeof shadow.getShadow == 'function');
ok(typeof shadow.toString == 'function');
equal(shadow.getShadow(), '0px 0px 0px rgb(0,0,0)');
equal(shadow.toString(), '0px 0px 0px rgb(0,0,0)');
});
test('toObject', function() {