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.

25 lines
604 B

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