From d190c31e8b3f61055f8be6eeb7eb043d0b176424 Mon Sep 17 00:00:00 2001 From: Stefan Kienzle Date: Thu, 5 Sep 2013 18:09:34 +0200 Subject: [PATCH] Renamed `fabric.Shadow.getShadow` to `fabric.Shadow.toString` --- src/shadow.class.js | 5 +++-- src/shapes/text.cufon.js | 2 +- test/unit/shadow.js | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/shadow.class.js b/src/shadow.class.js index 6b9688c2..24d22d3f 100644 --- a/src/shadow.class.js +++ b/src/shadow.class.js @@ -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 '); }, diff --git a/src/shapes/text.cufon.js b/src/shapes/text.cufon.js index a066afeb..d86b1e32 100644 --- a/src/shapes/text.cufon.js +++ b/src/shapes/text.cufon.js @@ -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, diff --git a/test/unit/shadow.js b/test/unit/shadow.js index 6f3fbb31..3292b8d4 100644 --- a/test/unit/shadow.js +++ b/test/unit/shadow.js @@ -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() {