Minor Style refactoring clean-ups.

This commit is contained in:
Jürg Lehni 2013-04-09 16:51:57 -07:00
parent b4a99415d0
commit b3b0fa649b
3 changed files with 9 additions and 12 deletions

View file

@ -306,7 +306,7 @@ var Item = this.Item = Base.extend(Callback, {
}
this._name = name || undefined;
this._changed(/*#=*/ ChangeFlag.ATTRIBUTE);
}
},
/**
* The path style of the item.
@ -364,6 +364,13 @@ var Item = this.Item = Base.extend(Callback, {
* });
* path2.style = myStyle;
*/
getStyle: function() {
return this._style;
},
setStyle: function(style) {
this._style.initialize(style);
}
}, Base.each(['locked', 'visible', 'blendMode', 'opacity', 'guide'],
// Produce getter/setters for properties. We need setters because we want to
// call _changed() if a property was modified.

View file

@ -158,15 +158,6 @@ var Style = this.Style = Base.extend(new function() {
};
});
// Define accessor on Item class for this style.
item.getStyle = function() {
return this._style;
};
item.setStyle = function(style) {
this._style.initialize(style);
};
Item.inject(item);
return fields;
}, /** @lends Style# */{

View file

@ -65,6 +65,7 @@ var paper = new function() {
/*#*/ include('item/PlacedItem.js');
/*#*/ include('item/Raster.js');
/*#*/ include('item/PlacedSymbol.js');
/*#*/ include('item/Style.js');
/*#*/ include('item/HitResult.js');
/*#*/ include('path/Segment.js');
@ -81,8 +82,6 @@ var paper = new function() {
/*#*/ include('text/TextItem.js');
/*#*/ include('text/PointText.js');
/*#*/ include('style/Style.js');
/*#*/ include('color/Color.js');
/*#*/ include('color/Gradient.js');
/*#*/ include('color/GradientStop.js');