mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-20 06:00:59 +00:00
Merge pull request #827 from Kienz/patch-1
Rename `fabric.Shadow.getShadow` to `fabric.Shadow.toString`
This commit is contained in:
commit
03a7326ef8
3 changed files with 7 additions and 6 deletions
|
|
@ -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 ');
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue