mirror of
https://github.com/rough-stuff/rough.git
synced 2026-01-14 17:07:58 -05:00
31 lines
690 B
HTML
31 lines
690 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 Curve</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, {
|
|
options: {
|
|
strokeLineDash: [15, 5],
|
|
strokeLineDashOffset: 10
|
|
}
|
|
});
|
|
|
|
const ctx = rc.ctx;
|
|
ctx.translate(150, 150);
|
|
ctx.scale(1, -1);
|
|
rc.path('M-100, 0L0 100L100 100Z', { fill: 'red' });
|
|
|
|
</script>
|
|
</body>
|
|
|
|
</html> |