Created
June 10, 2014 01:05
-
-
Save waylau/a1784c010e11721b9169 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (SVG.supported) { | |
// create svg drawing | |
var draw = SVG('canvas').size('100%', '100%') | |
var rect2 = draw.rect(); | |
//var rect2 = draw.circle(); | |
//var rect2 = draw.polyline(); | |
//var rect2 = draw.ellipse(); | |
draw.on('mousedown', function(event){ | |
rect2.draw(event); | |
}); | |
draw.on('mouseup', function(event){ | |
rect2.draw(event); | |
}); | |
} else { | |
alert('SVG not supported') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment