GT2/GT2-iOS/node_modules/art/shapes/ellipse.js

16 lines
261 B
JavaScript
Raw Normal View History

2018-02-12 17:26:06 +00:00
var Shape = require('./generic');
module.exports = Shape(function(width, height){
this.width = width;
this.height = height;
var rx = width / 2, ry = height / 2;
this.path
.move(0, ry)
.arc(width, 0, rx, ry)
.arc(-width, 0, rx, ry)
.close();
});