2011-02-21 08:31:26 -05:00
|
|
|
<!DOCTYPE html>
|
2011-02-08 07:16:43 -05:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
|
<title>Example</title>
|
2011-05-05 11:25:17 -04:00
|
|
|
<link rel="stylesheet" href="../css/style.css">
|
2011-03-07 20:07:26 -05:00
|
|
|
<script type="text/javascript">var root = '../../'</script>
|
2011-03-07 18:11:41 -05:00
|
|
|
<script type="text/javascript" src="../../src/load.js"></script>
|
2011-03-04 06:38:38 -05:00
|
|
|
<script type="text/paperscript" canvas="canvas">
|
2011-05-06 10:54:36 -04:00
|
|
|
// Any newly created item will inherit the following styles:
|
2011-05-16 08:33:15 -04:00
|
|
|
project.currentStyle = {
|
2011-05-06 10:54:36 -04:00
|
|
|
strokeColor: 'black',
|
|
|
|
strokeWidth: 5,
|
|
|
|
strokeJoin: 'round',
|
|
|
|
strokeCap: 'round'
|
|
|
|
};
|
|
|
|
|
|
|
|
// The user has to drag the mouse at least 30pt before the mouse drag
|
|
|
|
// event is fired:
|
|
|
|
tool.minDistance = 30;
|
|
|
|
|
2011-03-04 06:38:38 -05:00
|
|
|
var path;
|
|
|
|
function onMouseDown(event) {
|
|
|
|
path = new Path();
|
|
|
|
path.add(event.point);
|
2011-02-08 07:16:43 -05:00
|
|
|
}
|
2011-05-06 10:54:36 -04:00
|
|
|
|
2011-03-04 06:38:38 -05:00
|
|
|
function onMouseDrag(event) {
|
|
|
|
path.arcTo(event.point, true);
|
|
|
|
}
|
2011-02-08 07:16:43 -05:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2011-05-14 06:04:02 -04:00
|
|
|
<canvas id="canvas" resize keepalive="true"></canvas>
|
2011-02-08 07:16:43 -05:00
|
|
|
</body>
|