Web Interface For Lite Argus Control modules
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.

80 lines
2.2 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. <!-- IE 9: display inline SVG -->
  8. <meta http-equiv="X-UA-Compatible" content="IE=9">
  9. <script type="text/javascript" src="../../dist/paper-full.js"></script>
  10. <script type="text/paperscript" canvas="canvas">
  11. // This "arbitrary" shape triggered rectangles in the original code,
  12. // since point2 is as far from point0 as point3 is from point1.
  13. var path = new Path({
  14. closed: true,
  15. strokeColor: 'black'
  16. });
  17. path.moveTo(0, 0);
  18. path.lineTo(50, 50);
  19. path.lineTo(100, 100);
  20. path.lineTo(-50, 150);
  21. path.position += 100;
  22. var rect = new Path.Rectangle({
  23. point: [200, 100],
  24. size: [200, 300],
  25. fillColor: 'red'
  26. });
  27. rect.rotate(40);
  28. var circle = new Path.Circle({
  29. center: [200, 300],
  30. radius: 100,
  31. fillColor: 'green'
  32. });
  33. circle.scale(0.5, 1);
  34. circle.rotate(40);
  35. var ellipse = new Path.Ellipse({
  36. point: [300, 300],
  37. size: [100, 200],
  38. fillColor: 'blue'
  39. });
  40. ellipse.rotate(-40);
  41. var rect = new Path.Rectangle({
  42. point: [250, 20],
  43. size: [200, 300],
  44. radius: [40, 20],
  45. fillColor: 'yellow'
  46. });
  47. rect.rotate(-20);
  48. rect.data = {
  49. string: '----',
  50. number: 1234,
  51. array: ['a ray', 'some rays'],
  52. bool: true,
  53. nil: null,
  54. point: new Point(12, 34),
  55. size: new Size(12, 34),
  56. rectangle: new Rectangle([12, 34], [56, 78]),
  57. deep: {
  58. deeper: {
  59. deepest: true
  60. }
  61. }
  62. };
  63. var parallelogram = new Path({
  64. closed: true,
  65. segments: [[50, 0], [50, 100], [90, 120], [90, 20]],
  66. fillColor: '#99c'
  67. });
  68. document.body.appendChild(project.exportSVG({ matchShapes: true }));
  69. </script>
  70. </head>
  71. <body>
  72. <canvas id="canvas" width="500" height="500"></canvas>
  73. </body>
  74. </html>