mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Simplify Circles example.
This commit is contained in:
parent
74dd89a68b
commit
1587ac857d
1 changed files with 1 additions and 5 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue