mirror of
https://github.com/rough-stuff/rough.git
synced 2026-01-14 17:07:58 -05:00
29 lines
640 B
HTML
29 lines
640 B
HTML
<!doctype html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
|
|
<title>RoughJS Polygon</title>
|
|
</head>
|
|
|
|
<body>
|
|
<canvas width="800" height="800"></canvas>
|
|
|
|
<script type="module">
|
|
import rough from '../../bin/rough.js';
|
|
const canvas = document.querySelector('canvas');
|
|
const rc = rough.canvas(canvas);
|
|
|
|
rc.polygon([
|
|
[10, 300],
|
|
[150, 200],
|
|
[310, 300],
|
|
[200, 50],
|
|
[100, 50]
|
|
], { fill: 'red', fillStyle: 'zigzag', hachureGap: 20, hachureAngle: 85 });
|
|
|
|
</script>
|
|
</body>
|
|
|
|
</html> |