Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function drawPolygon(parentGfx, points, attrs) {
var pointsString = points.map(function(point) {
return point.x + ',' + point.y;
}).join(' ');
var polygon = svgCreate('polygon');
svgAttr(polygon, {
points: pointsString
});
svgAttr(polygon, attrs);
svgAppend(parentGfx, polygon);
return polygon;
}
function createOutline(gfx, bounds) {
var outline = svgCreate('rect');
svgAttr(outline, assign({
x: 10,
y: 10,
width: 100,
height: 100
}, OUTLINE_STYLE));
svgAppend(gfx, outline);
return outline;
}
create: function(context) {
var container = canvas.getDefaultLayer(),
frame;
frame = context.frame = svgCreate('rect');
svgAttr(frame, {
class: 'djs-lasso-overlay',
width: 1,
height: 1,
x: 0,
y: 0
});
svgAppend(container, frame);
},