mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-03-13 16:33:28 -04:00
Move over content handling from PointText to TextItem.
This commit is contained in:
parent
c8a1bf4fce
commit
ad04db85aa
2 changed files with 2 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue