Skip to content

Instantly share code, notes, and snippets.

@tanraya
Created November 21, 2013 17:54
Show Gist options
  • Save tanraya/7586312 to your computer and use it in GitHub Desktop.
Save tanraya/7586312 to your computer and use it in GitHub Desktop.
// With SVG.js
var width = 500
var height = 20
var lineHeight = 3
var step = 10
var draw = SVG('canvas')
var rect = draw.rect(width, height).fill('#f09')
for (var i = 1; i < width/step; i++) {
var x1 = i * step
var y1 = -step
var x2 = i * step
var y2 = lineHeight
draw.line(x1, y1, x2, y2).stroke({ width: 1, color: '#000' })
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment