Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
draw = SVG().addTo(drawing).size(100,100)
})
afterEach(function(){
draw.remove()
})
// strip spaces from result
window.stripped = function(string) {
string = string.replace(/\s+/g, '')
if(string.slice(-1) == ';') string = string.slice(0, -1)
return string
}
// This is needed because of IE11 which uses space as a delimiter in matrix
window.matrixStringToArray = function(source){
return source
.replace(/matrix\(|\)/, '')
.split(SVG.regex.delimiter)
.map(parseFloat)
}
// This is needed because of IE11 creating values like 2.99999 when calculating a transformed box
window.roundBox = function(box) {
return new SVG.Box(
Math.round(box.x),
Math.round(box.y),
Math.round(box.width),
Math.round(box.height)
)
}