Implement Item#data cloning.

Closes #340.
This commit is contained in:
Jürg Lehni 2013-11-28 22:27:14 +01:00
parent 91a5bb9f88
commit 7e65426158
2 changed files with 4 additions and 0 deletions

View file

@ -1313,6 +1313,8 @@ var Item = Base.extend(Callback, /** @lends Item# */{
}
// Use Matrix#initialize to easily copy over values.
copy._matrix.initialize(this._matrix);
// Copy over _data as well.
copy._data = this._data ? Base.clone(this._data) : null;
// Copy over the selection state, use setSelected so the item
// is also added to Project#selectedItems if it is selected.
copy.setSelected(this._selected);

View file

@ -760,6 +760,8 @@ var Color = Base.extend(new function() {
*
* @return {Color} a copy of the color object
*/
// NOTE: There is no need to actually implement this, since it's the
// same as Base#clone()
/**
* {@grouptitle String Representations}