Move over content handling from PointText to TextItem.

This commit is contained in:
Jürg Lehni 2011-06-19 23:23:52 +01:00
parent c8a1bf4fce
commit ad04db85aa
2 changed files with 2 additions and 3 deletions

View file

@ -38,14 +38,12 @@ var PointText = this.PointText = TextItem.extend({
initialize: function(point) {
this.base();
var point = Point.read(arguments);
this.content = '';
this._point = LinkedPoint.create(this, 'setPoint', point.x, point.y);
this._matrix = new Matrix().translate(point);
},
clone: function() {
var copy = this._clone(new PointText(this._point));
copy.content = this.content;
// Use Matrix#initialize to easily copy over values.
copy._matrix.initialize(this._matrix);
return copy;

View file

@ -30,7 +30,7 @@ var TextItem = this.TextItem = Item.extend({
*/
initialize: function() {
this.base();
this.content = null;
this.content = '';
this._characterStyle = CharacterStyle.create(this);
this.setCharacterStyle(this._project.getCurrentStyle());
this._paragraphStyle = ParagraphStyle.create(this);
@ -70,6 +70,7 @@ var TextItem = this.TextItem = Item.extend({
*/
_clone: function(copy) {
copy.content = this.content;
copy.setCharacterStyle(this._characterStyle);
copy.setParagraphStyle(this._paragraphStyle);
return this.base(copy);