Web UI for ARGUS server
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.

55 lines
1.6 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Rotated Primitives</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. // This "arbitrary" shape triggered rectangles in the original code,
  10. // since point2 is as far from point0 as point3 is from point1.
  11. var path = new Path({
  12. closed: true,
  13. strokeColor: 'black'
  14. });
  15. path.moveTo(0, 0);
  16. path.lineTo(50, 50);
  17. path.lineTo(100, 100);
  18. path.lineTo(-50, 150);
  19. path.position += 100;
  20. var rect = new Path.Rectangle({
  21. point: [200, 100],
  22. size: [200, 300],
  23. fillColor: 'red'
  24. });
  25. rect.rotate(40);
  26. var circle = new Path.Circle({
  27. center: [200, 300],
  28. radius: 100,
  29. fillColor: 'green'
  30. });
  31. circle.scale(0.5, 1);
  32. circle.rotate(40);
  33. var rect = new Path.Rectangle({
  34. point: [250, 20],
  35. size: [200, 300],
  36. radius: [40, 20],
  37. fillColor: 'yellow'
  38. });
  39. rect.rotate(-20);
  40. window._json = project.exportJSON();
  41. console.log(window._json);
  42. </script>
  43. <script type="text/paperscript" canvas="canvas2">
  44. project.importJSON(window._json);
  45. </script>
  46. </head>
  47. <body>
  48. <canvas id="canvas1" width="500" height="500"></canvas>
  49. <canvas id="canvas2" width="500" height="500"></canvas>
  50. </body>
  51. </html>