paper.js/examples/Scripts/strokeJoin.html

68 lines
2.6 KiB
HTML
Raw Normal View History

2011-02-08 07:16:26 -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>
<script type="text/javascript" src="../../lib/Bootstrap.js"></script>
<script type="text/javascript" src="../../src/Paper.js"></script>
<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>
<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>
<script type="text/javascript" src="../../src/basic/Matrix.js"></script>
<script type="text/javascript" src="../../src/document/Doc.js"></script>
<script type="text/javascript" src="../../src/item/Item.js"></script>
<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>
<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>
<script type="text/javascript" src="../../src/path/Path.Constructors.js"></script>
2011-02-08 07:16:26 -05:00
<script>
window.onload = function() {
var canvas = document.getElementById('canvas');
2011-02-12 13:12:56 -05:00
var doc = new Doc(canvas);
2011-02-08 07:16:26 -05:00
var path = new Path([100, 150], [150, 200], [200, 150]);
path.strokeColor = 'black';
path.strokeWidth = 30;
path.strokeJoin = 'round';
var path = new Path([240, 150], [290, 200], [340, 150]);
path.strokeColor = 'black';
path.strokeWidth = 30;
2011-02-08 07:16:26 -05:00
path.strokeJoin = 'bevel';
var path = new Path([380, 150], [430, 200], [480, 150]);
path.strokeColor = 'black';
path.strokeWidth = 30;
path.strokeJoin = 'miter';
var path = new Path([100, 250], [150, 300], [200, 250]);
path.strokeColor = 'black';
path.strokeWidth = 30;
path.strokeJoin = 'round';
path.strokeCap = 'round';
var path = new Path([240, 250], [290, 300], [340, 250]);
path.strokeColor = 'black';
path.strokeWidth = 30;
path.strokeJoin = 'bevel';
path.strokeCap = 'square';
var path = new Path([380, 250], [430, 300], [480, 250]);
path.strokeColor = 'black';
path.strokeWidth = 30;
path.strokeJoin = 'miter';
path.strokeCap = 'butt';
2011-02-08 07:16:26 -05:00
doc.redraw();
}
</script>
</head>
<body>
<canvas id='canvas' width=1024 height=768></canvas>
</body>