magic4
This commit is contained in:
28
static/Magic4/paperjs-v0.12.15/examples/Tools/Circles.html
Normal file
28
static/Magic4/paperjs-v0.12.15/examples/Tools/Circles.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<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'
|
||||
});
|
||||
|
||||
// Remove this path on the next drag event:
|
||||
path.removeOnDrag();
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="canvas" resize></canvas>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user