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.

37 lines
970 B

  1. /**
  2. The base kind for shapes that can be drawn into the canvas.
  3. This doesn't have a default rendering, but an event handler
  4. may call the _draw_ method on it.
  5. Kinds derived from this one should provide their own implementation of
  6. _renderSelf_. If more complex operations are needed for filled mode or
  7. outline mode, override the _fill_ or _outline_ methods, respectively.
  8. */
  9. enyo.kind({
  10. name: "enyo.canvas.Shape",
  11. kind: enyo.canvas.Control,
  12. published: {
  13. //* Color used to draw the interior of the shape
  14. color: "red",
  15. //* Color used to draw the outline of the shape
  16. outlineColor: ""
  17. },
  18. //* @protected
  19. fill: function(inContext) {
  20. inContext.fill();
  21. },
  22. outline: function(inContext) {
  23. inContext.stroke();
  24. },
  25. //* @public
  26. draw: function(inContext) {
  27. if (this.color) {
  28. inContext.fillStyle = this.color;
  29. this.fill(inContext);
  30. }
  31. if (this.outlineColor) {
  32. inContext.strokeStyle = this.outlineColor;
  33. this.outline(inContext);
  34. }
  35. }
  36. });