mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-06-08 19:24:15 -04:00
Rename Document -> Project, DocumentView -> ProjectView, paper.document -> paper.project and paper.documents -> paper.projects, to avoid name clashing with window.document.
This commit is contained in:
parent
edd36e7df8
commit
cfe968d30e
37 changed files with 699 additions and 183 deletions
examples/Scripts
|
@ -22,7 +22,7 @@
|
|||
path.arcTo(point + vector, true);
|
||||
}
|
||||
}
|
||||
document.activeLayer.appendBottom(path);
|
||||
project.activeLayer.appendBottom(path);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<script type="text/javascript">var root = '../../'</script>
|
||||
<script type="text/javascript" src="../../src/load.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas">
|
||||
document.currentStyle.fillColor = 'black';
|
||||
project.currentStyle.fillColor = 'black';
|
||||
var path1 = new Path.Rectangle([200, 200], [100, 100]);
|
||||
var path2 = new Path.Rectangle([50, 50], [200, 200]);
|
||||
var path3 = new Path.Rectangle([0, 0], [400, 400]);
|
||||
|
|
|
@ -28,11 +28,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
document.activeLayer.position = view.center;
|
||||
project.activeLayer.position = view.center;
|
||||
|
||||
// Reposition the paths whenever the window is resized:
|
||||
function onResize(event) {
|
||||
document.activeLayer.position = view.center;
|
||||
project.activeLayer.position = view.center;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<script type="text/paperscript" canvas="canvas">
|
||||
var path;
|
||||
var rect = new Rectangle([150, 150], [300, 300]);
|
||||
document.currentStyle.fillColor = 'black';
|
||||
project.currentStyle.fillColor = 'black';
|
||||
|
||||
function onFrame(event) {
|
||||
if (path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue