Simplify Circles example.

This commit is contained in:
Jonathan Puckey 2011-05-06 15:51:26 +01:00
parent 74dd89a68b
commit 1587ac857d

View file

@ -16,17 +16,13 @@
var path;
function onMouseDrag(event) {
if (path) path.remove();
// The radius is the distance between the position
// where the user clicked and the current position
// of the mouse.
var radius = (event.downPoint - event.point).length;
path = new Path.Circle(event.downPoint, radius);
path.removeOnDrag();
};
function onMouseUp(event) {
path = null;
}
</script>
</head>
<body>