mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Switch from new Base() to Base.set({}) where possible.
This commit is contained in:
parent
009761d13c
commit
c3fff9fa83
5 changed files with 6 additions and 6 deletions
|
@ -107,7 +107,7 @@ var HitResult = Base.extend(/** @lends HitResult# */{
|
|||
* @private
|
||||
*/
|
||||
getOptions: function(options) {
|
||||
return new Base({
|
||||
return Base.set({
|
||||
// Type of item, for instanceof check: Group, Layer, Path,
|
||||
// CompoundPath, Shape, Raster, SymbolItem, ...
|
||||
type: null,
|
||||
|
|
|
@ -30,8 +30,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
|
|||
*/
|
||||
extend: function extend(src) {
|
||||
if (src._serializeFields)
|
||||
src._serializeFields = new Base(
|
||||
this.prototype._serializeFields, src._serializeFields);
|
||||
src._serializeFields = Base.set({},
|
||||
this.prototype._serializeFields, src._serializeFields);
|
||||
return extend.base.apply(this, arguments);
|
||||
},
|
||||
|
||||
|
|
|
@ -266,7 +266,7 @@ var CompoundPath = PathItem.extend(/** @lends CompoundPath# */{
|
|||
// compound path forms one shape.
|
||||
// Also support legacy format `type: 'path'`.
|
||||
options.class === Path || options.type === 'path' ? options
|
||||
: new Base(options, { fill: false }));
|
||||
: Base.set({}, options, { fill: false }));
|
||||
},
|
||||
|
||||
_draw: function(ctx, param, strokeMatrix) {
|
||||
|
|
|
@ -90,7 +90,7 @@ var Style = Base.extend(new function() {
|
|||
selectedColor: null
|
||||
},
|
||||
// For TextItem, override default fillColor and add text-specific properties
|
||||
textDefaults = new Base(defaults, {
|
||||
textDefaults = Base.set({}, defaults, {
|
||||
fillColor: new Color(), // black
|
||||
// Characters
|
||||
fontFamily: 'sans-serif',
|
||||
|
|
|
@ -408,7 +408,7 @@ var comparators = {
|
|||
// Cloning SymbolItems does not result in cloned
|
||||
// SymbolDefinitions
|
||||
options && options.cloned
|
||||
? new Base(options, { cloned: false })
|
||||
? Base.set({}, options, { cloned: false })
|
||||
: options,
|
||||
['symbol']);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue