Skip to content

Instantly share code, notes, and snippets.

@eerne
Created January 7, 2011 22:33
Show Gist options
  • Save eerne/770233 to your computer and use it in GitHub Desktop.
Save eerne/770233 to your computer and use it in GitHub Desktop.
Based on ART.Ellipse but with center in the middle rather than top/left
ART.Ellipse2 = new Class({
Extends: ART.Shape,
initialize: function(width, height){
this.parent();
if (width != null && height != null) this.draw(width, height);
},
draw: function(width, height){
var path = new ART.Path;
var rx = width / 2, ry = height / 2;
path.move(-rx, 0).arc(width, 0, rx, ry).arc(-width, 0, rx, ry);
return this.parent(path);
}
});
@eerne
Copy link
Author

eerne commented Jan 7, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment