not really known
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.

26 lines
702 B

  1. /**
  2. _enyo.canvas.Rectangle_ is a canvas control that draws a rectangle fitting
  3. the parameters specified in the _bounds_ property.
  4. */
  5. enyo.kind({
  6. name: "enyo.canvas.Rectangle",
  7. kind: enyo.canvas.Shape,
  8. published: {
  9. //* if true, clear the area of the rectangle instead of drawing it
  10. clear: false
  11. },
  12. //* @protected
  13. renderSelf: function(ctx) {
  14. if (this.clear) {
  15. ctx.clearRect(this.bounds.l, this.bounds.t, this.bounds.w, this.bounds.h);
  16. } else {
  17. this.draw(ctx);
  18. }
  19. },
  20. fill: function(ctx) {
  21. ctx.fillRect(this.bounds.l, this.bounds.t, this.bounds.w, this.bounds.h);
  22. },
  23. outline: function(ctx) {
  24. ctx.strokeRect(this.bounds.l, this.bounds.t, this.bounds.w, this.bounds.h);
  25. }
  26. });