This app provides monitoring and information features for the common freifunk user and the technical stuff of a freifunk community. Code base is taken from a TUM Practical Course project and added here to see if Freifunk Altdorf can use it. https://www.freifunk-altdorf.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
617 B

var Shape = require('./generic');
module.exports = Shape(function(width, height){
this.width = width;
this.height = height;
var path = this.path;
if (width < 0){
path.move(width, 0);
width = -width;
}
if (height < 0){
path.move(0, height);
height = -height;
}
if (width < height){
var r = width / 2;
path.move(0, r)
.arc(width, 0, r)
.line(0, height - width)
.arc(-width, 0, r)
.line(0, width - height);
} else {
var r = height / 2;
path.move(r, 0)
.line(width - height, 0)
.arc(0, height, r)
.line(height - width, 0)
.arc(0, -height, r);
}
path.close();
});