Circle.js 478 B

12345678910111213141516171819
  1. //CLASS:几何类型:圆
  2. function Circle(x, y, radius) {
  3. Geometry.apply(this, arguments);
  4. this.radius = radius;
  5. this.x = x;
  6. this.y = y;
  7. };
  8. Circle.prototype.getBounds = function () {
  9. if(!this.bounds) {
  10. this.bounds = new CanvasSketch.Bounds(this.x - this.radius, this.y - this.radius, this.x + this.radius, this.y + this.radius);
  11. return this.bounds;
  12. } else {
  13. return this.bounds;
  14. }
  15. };
  16. Circle.prototype.geoType = "Circle";