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.

25 lines
863 B

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Group Transform</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. var circle1 = new Path.Circle(new Point(100, 100), 50);
  12. circle1.fillColor = 'red';
  13. var circle2 = new Path.Circle(new Point(200, 100), 50);
  14. circle2.fillColor = 'blue';
  15. var group = new Group(circle1, circle2);
  16. group.translate([100, 100]);
  17. group.scale(0.5);
  18. group.rotate(10);
  19. document.body.appendChild(project.exportSVG());
  20. </script>
  21. </head>
  22. <body>
  23. <canvas id="canvas" width="500" height="500"></canvas>
  24. </body>
  25. </html>