mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
6c1c6bc2d5
easier testing.
32 lines
757 B
HTML
32 lines
757 B
HTML
<!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>
|