You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
926 B

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Rectangle Testing</title>
  6. <link rel="stylesheet" href="../css/style.css">
  7. <script type="text/javascript" src="../../dist/paper-full.js"></script>
  8. <script type="text/paperscript" canvas="canvas1">
  9. var path = new Path.Rectangle(new Point(50, 50), new Size(100, 50));
  10. path.style = {
  11. fillColor: 'white',
  12. strokeColor: 'black'
  13. };
  14. var copy = path.clone();
  15. copy.strokeColor = 'red';
  16. copy.rotate(-45);
  17. copy.scale(0.5);
  18. window._json = project.exportJSON();
  19. console.log(window._json);
  20. </script>
  21. <script type="text/paperscript" canvas="canvas2">
  22. project.importJSON(window._json);
  23. </script>
  24. </head>
  25. <body>
  26. <canvas id="canvas1" width="500" height="500"></canvas>
  27. <canvas id="canvas2" width="500" height="500"></canvas>
  28. </body>
  29. </html>