Files
rough/visual-tests/svg/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
832 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>
<svg width="800" height="800"></svg>
<script type="module">
import rough from '../../../bin/rough.js';
const svg = document.querySelector('svg');
const rc = rough.svg(svg, {
options: {
strokeLineDash: [15, 5],
strokeLineDashOffset: 10
}
});
svg.appendChild(rc.line(10, 10, 100, 10));
svg.appendChild(rc.line(10, 210, 500, 210));
svg.appendChild(rc.line(10, 20, 10, 110, { stroke: 'red' }));
svg.appendChild(rc.line(10, 10, 100, 10));
svg.appendChild(rc.line(50, 30, 200, 100, { stroke: 'blue', strokeWidth: 5 }));
</script>
</body>
</html>