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 
This commit is contained in:
Jürg Lehni 2015-05-11 19:39:39 +02:00
parent 783d1622b9
commit 27bb8a356f
9 changed files with 64 additions and 23 deletions
examples/JSON

View file

@ -6,15 +6,20 @@
<link rel="stylesheet" href="../css/style.css">
<script type="text/javascript" src="../../dist/paper-full.js"></script>
<script type="text/paperscript" canvas="canvas1">
var path = new Path.Circle(view.center, view.bounds.height * 0.4);
var path = new Path.Circle({
center: view.center,
radius: view.bounds.height * 0.4
});
path.fillColor = {
// gradient: [['yellow', 'red', 'black'], true],
stops: ['yellow', 'red', 'black'],
radial: true,
origin: path.position,
destination: path.bounds.rightCenter
}
path.strokeColor = 'black';
var symbol = new Symbol(path);
symbol.place(view.center);
window._json = project.exportJSON();
console.log(window._json);
</script>