Simplify Style creation.

This commit is contained in:
Jürg Lehni 2013-04-19 20:00:30 -07:00
parent 41a58acb8c
commit 3025c63179
3 changed files with 3 additions and 11 deletions

View file

@ -59,8 +59,8 @@ var Item = this.Item = Base.extend(Callback, {
// hierarchy. Used by Layer, where it's added to project.layers instead
if (!this._project)
paper.project.activeLayer.addChild(this);
this._style = Style.create(this);
this.setStyle(this._project.getCurrentStyle());
this._style = new Style(this._project._currentStyle);
this._style._item = this;
this._matrix = new Matrix();
if (point)
this._matrix.translate(point);

View file

@ -50,10 +50,10 @@ var Project = this.Project = PaperScopeItem.extend(/** @lends Project# */{
this.base(true);
this.layers = [];
this.symbols = [];
this._currentStyle = new Style();
this.activeLayer = new Layer();
if (view)
this.view = view instanceof View ? view : View.create(view);
this._currentStyle = new Style();
this._selectedItems = {};
this._selectedItemCount = 0;
// See Item#draw() for an explanation of _drawCount

View file

@ -216,14 +216,6 @@ var Style = this.Style = Base.extend(new function() {
+ this.getFont();
},
statics: {
create: function(item) {
var style = Base.create(this);
style._item = item;
return style;
}
}
// DOCS: why isn't the example code showing up?
/**
* Style objects don't need to be created directly. Just pass an object to