mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-06-09 03:34:16 -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
examples/JSON
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue