Skip to content

Instantly share code, notes, and snippets.

@soney
soney / get_rounded_rectangular_shape.js
Created July 30, 2011 22:21
Gets a rounded shape in the form of an SVG Path
var get_rounded_rectangular_shape = function(points, r) {
var sb;
if(r === 0) {
sb = new Array(3*(points.length+1));
//Set up a move to and a line to the initial point
sb[0] = "M";
sb[3*points.length] = "L";
sb[1] = sb[3*points.length + 1] = points[0][0];