mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
26 lines
No EOL
712 B
HTML
26 lines
No EOL
712 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Example</title>
|
|
<base href="../../">
|
|
<script type="text/javascript" src="lib/load.js"></script>
|
|
<script type="text/javascript" src="src/load.js"></script>
|
|
<script type="text/paperscript" canvas="canvas">
|
|
var path;
|
|
function onMouseDrag(event) {
|
|
if (path) path.remove();
|
|
var distance = (event.downPoint - event.point).length;
|
|
path = new Path.Circle(event.downPoint, distance);
|
|
path.strokeColor = 'black';
|
|
path.fillColor = 'white';
|
|
};
|
|
|
|
function onMouseUp(event) {
|
|
path = null;
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<canvas id='canvas' width=1024 height=768></canvas>
|
|
</body> |