Requires

Provides

Ellipse.js

Draw ellipses and circles without a hassle

License:
Public domain (http://unlicense.org).
Authors:
Yaroslaff Fedin
  1. 21
  2. 22
  3. 23
  4. 24
  5. 25
  6. 26
  7. 27
  8. 28
  9. 29
  10. 30
  11. 31
  12. 32
  13. 33
  14. 34
  15. 35
  16. 36
  17. 37
  18. 38
  19. 39
  20. 40
  21. 41
  22. 42
  23. 43
ART.Shape.Ellipse = new Class({ Extends: ART.Shape, properties: ['width', 'height'], 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(0, ry).arc(width, 0, rx, ry).arc(-width, 0, rx, ry); return this.parent(path); }, produce: function(delta) { return new ART.Shapes.Ellipse(this.style.width + delta * 2, this.style.height + delta * 2) } });