source: main/trunk/model-sites-dev/von-sparql/js/paper/examples/Tools/Circles.html@ 28914

Last change on this file since 28914 was 28914, checked in by ak19, 10 years ago

Supporting javascript libraries and bespoke code written by Steffan to support the von-sparql user interface

File size: 743 bytes
Line 
1<!DOCTYPE html>
2<html>
3<head>
4 <meta charset="UTF-8">
5 <title>Circles</title>
6 <link rel="stylesheet" href="../css/style.css">
7 <script type="text/javascript" src="../../dist/paper.js"></script>
8 <script type="text/paperscript" canvas="canvas">
9 function onMouseDrag(event) {
10 // The radius is the distance between the position
11 // where the user clicked and the current position
12 // of the mouse.
13 var path = new Path.Circle({
14 center: event.downPoint,
15 radius: (event.downPoint - event.point).length,
16 fillColor: 'white',
17 strokeColor: 'black'
18 });
19
20 // Remove this path on the next drag event:
21 path.removeOnDrag();
22 };
23 </script>
24</head>
25<body>
26 <canvas id="canvas" resize></canvas>
27</body>
28</html>
Note: See TracBrowser for help on using the repository browser.