paper.js/examples/Tools/Circles.html

25 lines
No EOL
701 B
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Example</title>
<script type="text/javascript">var loadBase = '../../'</script>
<script type="text/javascript" src="../../src/load.js"></script>
<script type="text/paperscript" canvas="canvas">
var path;
function onMouseDrag(event) {
if (path) path.remove();
var distance = (event.downPoint - event.point).length;
path = new Path.Circle(event.downPoint, distance);
path.strokeColor = 'black';
path.fillColor = 'white';
};
function onMouseUp(event) {
path = null;
}
</script>
</head>
<body>
<canvas id='canvas' width=1024 height=768></canvas>
</body>