paper.js/examples/Tools/Circles.html

28 lines
743 B
HTML
Raw Normal View History

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