paper.js/examples/Tools/Circles.html

29 lines
749 B
HTML
Raw Normal View History

2011-02-21 14:31:26 +01:00
<!DOCTYPE html>
2011-02-08 13:16:43 +01:00
<html>
<head>
2013-06-02 13:41:10 -07: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>
2011-03-04 12:38:38 +01:00
<script type="text/paperscript" canvas="canvas">
function onMouseDrag(event) {
2011-04-23 16:30:29 +02:00
// The radius is the distance between the position
// where the user clicked and the current position
// of the mouse.
2013-03-09 16:02:11 +01: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 15:51:26 +01:00
path.removeOnDrag();
2011-03-04 12:38:38 +01:00
};
2011-02-08 13:16:43 +01:00
</script>
</head>
<body>
<canvas id="canvas" resize></canvas>
2011-05-31 00:27:39 +02:00
</body>
</html>