From 3025c631795d1be31e245404bb65eba6bda0a862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 19 Apr 2013 20:00:30 -0700 Subject: [PATCH] Simplify Style creation. --- src/item/Item.js | 4 ++-- src/project/Project.js | 2 +- src/style/Style.js | 8 -------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/item/Item.js b/src/item/Item.js index 0f0cfcc1..6e816cff 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -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); diff --git a/src/project/Project.js b/src/project/Project.js index 6ac1cf65..c6021acd 100644 --- a/src/project/Project.js +++ b/src/project/Project.js @@ -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 diff --git a/src/style/Style.js b/src/style/Style.js index 7074c7c9..28e63844 100644 --- a/src/style/Style.js +++ b/src/style/Style.js @@ -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