From fdd62ed929d14c2733c8033f49f596b0999ac554 Mon Sep 17 00:00:00 2001 From: "Richard D. Worth" Date: Thu, 30 Jun 2011 09:12:14 -0400 Subject: [PATCH] TextItem content: Added coersion to string in content setter since 0 number is falsy but '0' string is not. Removed coersion from PathStructure example (introduced in 5637b3e37e4541c4e78180a168107be8282c136f line 64) --- dist/docs/resources/js/paper.js | 2 +- dist/paper.js | 2 +- examples/Scripts/PathStructure.html | 2 +- src/text/TextItem.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/docs/resources/js/paper.js b/dist/docs/resources/js/paper.js index 5a0ce20c..bde2b29e 100644 --- a/dist/docs/resources/js/paper.js +++ b/dist/docs/resources/js/paper.js @@ -5010,7 +5010,7 @@ var TextItem = this.TextItem = Item.extend({ setContent: function(content) { this._changed(Change.CONTENT); - this._content = content; + this._content = '' + content; }, getCharacterStyle: function() { diff --git a/dist/paper.js b/dist/paper.js index 5a0ce20c..bde2b29e 100644 --- a/dist/paper.js +++ b/dist/paper.js @@ -5010,7 +5010,7 @@ var TextItem = this.TextItem = Item.extend({ setContent: function(content) { this._changed(Change.CONTENT); - this._content = content; + this._content = '' + content; }, getCharacterStyle: function() { diff --git a/examples/Scripts/PathStructure.html b/examples/Scripts/PathStructure.html index 3da7a1f9..7b92f95f 100644 --- a/examples/Scripts/PathStructure.html +++ b/examples/Scripts/PathStructure.html @@ -15,7 +15,7 @@ for (var i = 0; i < 3; i++) { var text = new PointText(); - text.content = '' + i; + text.content = i; text.justification = 'center'; text.fontSize = 9; segmentTexts.push(text); diff --git a/src/text/TextItem.js b/src/text/TextItem.js index 6e2ff8df..9354e4cb 100644 --- a/src/text/TextItem.js +++ b/src/text/TextItem.js @@ -80,7 +80,7 @@ var TextItem = this.TextItem = Item.extend(/** @lends TextItem# */{ setContent: function(content) { this._changed(Change.CONTENT); - this._content = content; + this._content = '' + content; }, /**