mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Minor Style refactoring clean-ups.
This commit is contained in:
parent
b4a99415d0
commit
b3b0fa649b
3 changed files with 9 additions and 12 deletions
|
@ -306,7 +306,7 @@ var Item = this.Item = Base.extend(Callback, {
|
||||||
}
|
}
|
||||||
this._name = name || undefined;
|
this._name = name || undefined;
|
||||||
this._changed(/*#=*/ ChangeFlag.ATTRIBUTE);
|
this._changed(/*#=*/ ChangeFlag.ATTRIBUTE);
|
||||||
}
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The path style of the item.
|
* The path style of the item.
|
||||||
|
@ -364,6 +364,13 @@ var Item = this.Item = Base.extend(Callback, {
|
||||||
* });
|
* });
|
||||||
* path2.style = myStyle;
|
* path2.style = myStyle;
|
||||||
*/
|
*/
|
||||||
|
getStyle: function() {
|
||||||
|
return this._style;
|
||||||
|
},
|
||||||
|
|
||||||
|
setStyle: function(style) {
|
||||||
|
this._style.initialize(style);
|
||||||
|
}
|
||||||
}, Base.each(['locked', 'visible', 'blendMode', 'opacity', 'guide'],
|
}, Base.each(['locked', 'visible', 'blendMode', 'opacity', 'guide'],
|
||||||
// Produce getter/setters for properties. We need setters because we want to
|
// Produce getter/setters for properties. We need setters because we want to
|
||||||
// call _changed() if a property was modified.
|
// call _changed() if a property was modified.
|
||||||
|
|
|
@ -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);
|
Item.inject(item);
|
||||||
return fields;
|
return fields;
|
||||||
}, /** @lends Style# */{
|
}, /** @lends Style# */{
|
|
@ -65,6 +65,7 @@ var paper = new function() {
|
||||||
/*#*/ include('item/PlacedItem.js');
|
/*#*/ include('item/PlacedItem.js');
|
||||||
/*#*/ include('item/Raster.js');
|
/*#*/ include('item/Raster.js');
|
||||||
/*#*/ include('item/PlacedSymbol.js');
|
/*#*/ include('item/PlacedSymbol.js');
|
||||||
|
/*#*/ include('item/Style.js');
|
||||||
/*#*/ include('item/HitResult.js');
|
/*#*/ include('item/HitResult.js');
|
||||||
|
|
||||||
/*#*/ include('path/Segment.js');
|
/*#*/ include('path/Segment.js');
|
||||||
|
@ -81,8 +82,6 @@ var paper = new function() {
|
||||||
/*#*/ include('text/TextItem.js');
|
/*#*/ include('text/TextItem.js');
|
||||||
/*#*/ include('text/PointText.js');
|
/*#*/ include('text/PointText.js');
|
||||||
|
|
||||||
/*#*/ include('style/Style.js');
|
|
||||||
|
|
||||||
/*#*/ include('color/Color.js');
|
/*#*/ include('color/Color.js');
|
||||||
/*#*/ include('color/Gradient.js');
|
/*#*/ include('color/Gradient.js');
|
||||||
/*#*/ include('color/GradientStop.js');
|
/*#*/ include('color/GradientStop.js');
|
||||||
|
|
Loading…
Reference in a new issue