2011-02-21 08:31:26 -05:00
|
|
|
<!DOCTYPE html>
|
2011-02-08 07:16:43 -05:00
|
|
|
<html>
|
|
|
|
<head>
|
2014-08-16 13:24:54 -04:00
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>Circles</title>
|
|
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
|
|
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
|
|
|
<script type="text/paperscript" canvas="canvas">
|
|
|
|
function onMouseDrag(event) {
|
|
|
|
// The radius is the distance between the position
|
|
|
|
// where the user clicked and the current position
|
|
|
|
// of the mouse.
|
|
|
|
var path = new Path.Circle({
|
|
|
|
center: event.downPoint,
|
|
|
|
radius: (event.downPoint - event.point).length,
|
|
|
|
fillColor: 'white',
|
|
|
|
strokeColor: 'black'
|
|
|
|
});
|
2013-03-09 10:02:11 -05:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
// Remove this path on the next drag event:
|
|
|
|
path.removeOnDrag();
|
|
|
|
};
|
|
|
|
</script>
|
2011-02-08 07:16:43 -05:00
|
|
|
</head>
|
|
|
|
<body>
|
2014-08-16 13:24:54 -04:00
|
|
|
<canvas id="canvas" resize></canvas>
|
2011-05-30 18:27:39 -04:00
|
|
|
</body>
|
2014-04-06 07:44:19 -04:00
|
|
|
</html>
|