mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
6c1c6bc2d5
easier testing.
54 lines
1.2 KiB
HTML
54 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>SVGCircles</title>
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
<script type="text/javascript" src="../../dist/paper.js"></script>
|
|
<script type="text/javascript" src="../../src/svg/ExportSVG.js"></script>
|
|
<script type="text/paperscript" canvas="canvas">
|
|
// All newly created items will receive
|
|
// these style properties:
|
|
project.currentStyle = {
|
|
fillColor: 'white',
|
|
strokeColor: 'black'
|
|
};
|
|
|
|
var path;
|
|
function onMouseDown(event)
|
|
{
|
|
var radius = 100;
|
|
path = new Path.Circle(event.point, radius);
|
|
path.selected = true;
|
|
var svg = new ExportSVG();
|
|
var svgout = svg.exportPath(path);
|
|
console.log(svgout);
|
|
|
|
//making A new circle at a certain point
|
|
leftPoint = new Point(44,107);
|
|
|
|
var leftToTopHandle = new Point(0,55.22847);
|
|
var leftToTopHandle2 = new Point(0, -55.228);
|
|
|
|
rightPoint = new Point(244,107);
|
|
|
|
bottomPoint = new Point(144,207);
|
|
|
|
topPoint = new Point(144,7);
|
|
|
|
path2 = new Path(leftPoint);
|
|
path2.arcTo(topPoint, true);
|
|
|
|
|
|
|
|
|
|
|
|
path.removeOnDrag();
|
|
|
|
};
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<canvas id="canvas" resize></canvas>
|
|
</body>
|
|
</html>
|