Created an SVGRect.html to test exporting and modified SVGCircles.html for

easier testing.
This commit is contained in:
skierons 2012-09-17 19:34:46 -04:00
parent 2750b07189
commit 6c1c6bc2d5
5 changed files with 58 additions and 7 deletions

Binary file not shown.

Binary file not shown.

View file

@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Circles</title>
<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>
@ -15,15 +15,34 @@
};
var path;
function onMouseDrag(event) {
// The radius is the distance between the position
// where the user clicked and the current position
// of the mouse.
var radius = (event.downPoint - event.point).length;
path = new Path.Circle(event.downPoint, radius);
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();
};

View file

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SVGRect</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">
project.currentStyle =
{
fillColor: 'white',
strokeColor: 'black'
};
var path;
function onMouseDown(event)
{
var size = new Size(100,100);
path = new Path.Rectangle(event.point,size);
var svg = new ExportSVG();
var svgout = svg.exportPath(path);
console.log(svgout);
};
</script>
</head>
<body>
<canvas id="canvas" resize></canvas>
</body>
</html>

Binary file not shown.