mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Use same modification in static create() method of ParagraphStyle and CharacterStyle as was used in PathStyle.
This commit is contained in:
parent
2c03cb1ccb
commit
c07f9b438e
3 changed files with 8 additions and 8 deletions
|
@ -22,12 +22,11 @@ var CharacterStyle = this.CharacterStyle = PathStyle.extend({
|
|||
});
|
||||
this.base(style);
|
||||
},
|
||||
|
||||
|
||||
statics: {
|
||||
create: function(item, other) {
|
||||
create: function(item) {
|
||||
var style = new CharacterStyle(CharacterStyle.dont);
|
||||
style._item = item;
|
||||
style.initialize(other);
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,10 +22,9 @@ var ParagraphStyle = this.ParagraphStyle = Base.extend({
|
|||
},
|
||||
|
||||
statics: {
|
||||
create: function(item, other) {
|
||||
var style = new ParagraphStyle(PathStyle.dont);
|
||||
create: function(item) {
|
||||
var style = new CharacterStyle(CharacterStyle.dont);
|
||||
style._item = item;
|
||||
style.initialize(other);
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,9 @@ var TextItem = this.TextItem = Item.extend({
|
|||
initialize: function() {
|
||||
this.base();
|
||||
this.content = null;
|
||||
this._characterStyle = CharacterStyle.create(this);
|
||||
this.setCharacterStyle(this._project.getCurrentStyle());
|
||||
this._paragraphStyle = ParagraphStyle.create(this);
|
||||
this.setParagraphStyle();
|
||||
},
|
||||
|
||||
|
@ -29,7 +31,7 @@ var TextItem = this.TextItem = Item.extend({
|
|||
},
|
||||
|
||||
setCharacterStyle: function(style) {
|
||||
this._characterStyle = CharacterStyle.create(this, style);
|
||||
this._characterStyle.initialize(style);
|
||||
},
|
||||
|
||||
getParagraphStyle: function() {
|
||||
|
@ -37,6 +39,6 @@ var TextItem = this.TextItem = Item.extend({
|
|||
},
|
||||
|
||||
setParagraphStyle: function(style) {
|
||||
this._paragraphStyle = ParagraphStyle.create(this, style);
|
||||
this._paragraphStyle.initialize(style);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue