Files
rough/visual-tests/canvas/dashed/line.html
Preet fd621f41c3 Dashed line support (#159)
* stroke line dash for canvas

* canvas fill dashes

* dashed line support in SVG
2020-05-11 00:29:33 -07:00

32 lines
765 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 Line</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
}
});
rc.line(10, 10, 100, 10);
rc.line(10, 210, 500, 210);
rc.line(10, 20, 10, 110, { stroke: 'red' });
rc.line(10, 10, 100, 10);
rc.line(50, 30, 200, 100, { stroke: 'blue', strokeWidth: 5 });
</script>
</body>
</html>