mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-05 09:20:27 -04:00
Implement unique ids, and fix issue with Base.deserialize()
Gradient and Symbol were overriding each other in the dictionary, and dictionary entries could not contain references to other dictionary entries. Closes #690
This commit is contained in:
parent
783d1622b9
commit
27bb8a356f
9 changed files with 64 additions and 23 deletions
src/util
30
src/util/UID.js
Normal file
30
src/util/UID.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
|
||||
* http://paperjs.org/
|
||||
*
|
||||
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
|
||||
* http://scratchdisk.com/ & http://jonathanpuckey.com/
|
||||
*
|
||||
* Distributed under the MIT license. See LICENSE file for details.
|
||||
*
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @name UID
|
||||
* @namespace
|
||||
* @private
|
||||
*/
|
||||
var UID = {
|
||||
_id: 1,
|
||||
|
||||
/**
|
||||
* Returns the next unique id.
|
||||
* @method get
|
||||
* @return {Number} The next unique id
|
||||
* @static
|
||||
**/
|
||||
get: function() {
|
||||
return this._id++;
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue