2011-02-07 13:28:09 -05:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
|
|
|
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
|
<title>Example</title>
|
2011-02-12 11:59:39 -05:00
|
|
|
<script type="text/javascript" src="../../lib/Bootstrap.js"></script>
|
2011-02-12 10:20:10 -05:00
|
|
|
<script type="text/javascript" src="../../src/Paper.js"></script>
|
2011-02-16 16:35:17 -05:00
|
|
|
<script type="text/javascript" src="../../src/tool/ToolEvent.js"></script>
|
|
|
|
<script type="text/javascript" src="../../src/tool/ToolHandler.js"></script>
|
|
|
|
<script type="text/javascript" src="../../src/tool/Tool.js"></script>
|
2011-02-12 11:59:39 -05:00
|
|
|
<script type="text/javascript" src="../../src/basic/Point.js"></script>
|
|
|
|
<script type="text/javascript" src="../../src/basic/Rectangle.js"></script>
|
|
|
|
<script type="text/javascript" src="../../src/basic/Size.js"></script>
|
2011-02-16 16:35:17 -05:00
|
|
|
<script type="text/javascript" src="../../src/basic/Matrix.js"></script>
|
|
|
|
<script type="text/javascript" src="../../src/document/Doc.js"></script>
|
2011-02-20 17:28:38 -05:00
|
|
|
<script type="text/javascript" src="../../src/document/Symbol.js"></script>
|
2011-02-16 16:35:17 -05:00
|
|
|
<script type="text/javascript" src="../../src/item/Item.js"></script>
|
2011-02-20 17:28:38 -05:00
|
|
|
<script type="text/javascript" src="../../src/item/PlacedSymbol.js"></script>
|
2011-02-16 16:35:17 -05:00
|
|
|
<script type="text/javascript" src="../../src/item/Group.js"></script>
|
|
|
|
<script type="text/javascript" src="../../src/item/Layer.js"></script>
|
|
|
|
<script type="text/javascript" src="../../src/item/PathStyle.js"></script>
|
2011-02-12 11:59:39 -05:00
|
|
|
<script type="text/javascript" src="../../src/path/Segment.js"></script>
|
|
|
|
<script type="text/javascript" src="../../src/path/PathItem.js"></script>
|
|
|
|
<script type="text/javascript" src="../../src/path/Path.js"></script>
|
2011-02-17 09:56:07 -05:00
|
|
|
<script type="text/javascript" src="../../src/path/Path.Constructors.js"></script>
|
2011-02-19 11:56:15 -05:00
|
|
|
<script type="text/javascript" src="../../src/color/Color.js"></script>
|
|
|
|
<script type="text/javascript" src="../../src/color/RGBColor.js"></script>
|
|
|
|
<script type="text/javascript" src="../../src/color/GrayColor.js"></script>
|
2011-02-20 17:28:38 -05:00
|
|
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
|
|
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
|
|
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
2011-02-07 13:28:09 -05:00
|
|
|
<script>
|
|
|
|
window.onload = function() {
|
|
|
|
var canvas = document.getElementById('canvas');
|
|
|
|
var doc = new Doc(canvas);
|
|
|
|
|
|
|
|
var point = new Point(1024, 768).divide(2);
|
2011-02-13 11:26:24 -05:00
|
|
|
for (var i = 0; i < 30; i++) {
|
2011-02-07 13:28:09 -05:00
|
|
|
var vector = new Point(10 + 20 * i, 0).rotate(i);
|
2011-02-11 08:58:53 -05:00
|
|
|
var l = vector.length;
|
2011-02-07 13:28:09 -05:00
|
|
|
var path = new Path();
|
|
|
|
path.fillColor = i % 2 ? 'red' : 'black';
|
|
|
|
path.closed = true;
|
2011-02-13 11:26:24 -05:00
|
|
|
for (var j = 0; j < 17; j++) {
|
2011-02-07 13:28:09 -05:00
|
|
|
vector = vector.rotate(45 / 2);
|
2011-02-13 11:26:24 -05:00
|
|
|
if (j == 0) {
|
2011-02-07 13:28:09 -05:00
|
|
|
path.add(point.add(vector));
|
|
|
|
} else {
|
|
|
|
path.arcTo(point.add(vector), true);
|
|
|
|
}
|
|
|
|
}
|
2011-02-12 10:20:10 -05:00
|
|
|
doc.activeLayer.appendBottom(path);
|
2011-02-07 13:28:09 -05:00
|
|
|
}
|
2011-02-08 07:16:26 -05:00
|
|
|
doc.redraw();
|
2011-02-07 13:28:09 -05:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<canvas id='canvas' width=1024 height=768></canvas>
|
|
|
|
</body>
|