canvas.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.adaptor = adaptor;
  6. function adaptor(ctx) {
  7. // @ts-ignore
  8. return Object.assign(ctx, {
  9. setStrokeStyle: function setStrokeStyle(val) {
  10. ctx.strokeStyle = val;
  11. },
  12. setLineWidth: function setLineWidth(val) {
  13. ctx.lineWidth = val;
  14. },
  15. setLineCap: function setLineCap(val) {
  16. ctx.lineCap = val;
  17. },
  18. setFillStyle: function setFillStyle(val) {
  19. ctx.fillStyle = val;
  20. },
  21. setFontSize: function setFontSize(val) {
  22. ctx.font = String(val);
  23. },
  24. setGlobalAlpha: function setGlobalAlpha(val) {
  25. ctx.globalAlpha = val;
  26. },
  27. setLineJoin: function setLineJoin(val) {
  28. ctx.lineJoin = val;
  29. },
  30. setTextAlign: function setTextAlign(val) {
  31. ctx.textAlign = val;
  32. },
  33. setMiterLimit: function setMiterLimit(val) {
  34. ctx.miterLimit = val;
  35. },
  36. setShadow: function setShadow(offsetX, offsetY, blur, color) {
  37. ctx.shadowOffsetX = offsetX;
  38. ctx.shadowOffsetY = offsetY;
  39. ctx.shadowBlur = blur;
  40. ctx.shadowColor = color;
  41. },
  42. setTextBaseline: function setTextBaseline(val) {
  43. ctx.textBaseline = val;
  44. },
  45. createCircularGradient: function createCircularGradient() {},
  46. draw: function draw() {}
  47. });
  48. }