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.

56 lines
1.9 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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 point1 = new Point(10, 10);
  10. var size1 = new Size(50, 50);
  11. var rectangle1 = new Rectangle(point1, size1);
  12. var path1 = new Path.Rectangle(rectangle1);
  13. path1.strokeColor = 'black';
  14. path1.fillColor = 'red';
  15. path1.id = "square1";
  16. path1.strokeCap = "square";
  17. path1.opacity = ".1";
  18. path1.dashArray = [5, 2];
  19. path1.dashOffset = "0";
  20. var point2 = new Point(75, 75);
  21. var point22 = new Point(100, 100);
  22. var path2 = new Path.Rectangle(point2, point22);
  23. path2.strokeColor = 'red';
  24. path2.strokeWidth = '4';
  25. path2.fillColor = 'blue';
  26. path2.id = "square2";
  27. path2.strokeCap = "butt";
  28. path2.opacity = "1";
  29. var point3 = new Point(150, 150);
  30. var size3 = new Size(50, 50);
  31. var rectangle3 = new Rectangle(point3, size3);
  32. var path3 = new Path.Rectangle(rectangle3);
  33. path3.strokeColor = 'blue';
  34. var point4 = new Point(200, 200);
  35. var size4 = new Size(100, 100);
  36. var rectangle4 = new Rectangle(point4, size4);
  37. var cornerSize4 = new Size(30, 30);
  38. var path4 = new Path.Rectangle(rectangle4, cornerSize4);
  39. path4.strokeColor= 'yellow';
  40. path4.fillColor='purple';
  41. window._json = project.exportJSON();
  42. console.log(window._json);
  43. </script>
  44. <script type="text/paperscript" canvas="canvas2">
  45. project.importJSON(window._json);
  46. </script>
  47. </head>
  48. <body>
  49. <canvas id="canvas1" width="500" height="500"></canvas>
  50. <canvas id="canvas2" width="500" height="500"></canvas>
  51. </body>
  52. </html>