SGradient.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.SGradient = void 0;
  4. var _1 = require("./");
  5. var SGradient = (function () {
  6. function SGradient() {
  7. this.start = new _1.SPoint();
  8. this.end = new _1.SPoint();
  9. this.stopList = [];
  10. }
  11. Object.defineProperty(SGradient.prototype, "x1", {
  12. get: function () {
  13. return this.start.x;
  14. },
  15. set: function (value) {
  16. this.start.x = value;
  17. },
  18. enumerable: false,
  19. configurable: true
  20. });
  21. Object.defineProperty(SGradient.prototype, "y1", {
  22. get: function () {
  23. return this.start.y;
  24. },
  25. set: function (value) {
  26. this.start.y = value;
  27. },
  28. enumerable: false,
  29. configurable: true
  30. });
  31. Object.defineProperty(SGradient.prototype, "x2", {
  32. get: function () {
  33. return this.end.x;
  34. },
  35. set: function (value) {
  36. this.end.x = value;
  37. },
  38. enumerable: false,
  39. configurable: true
  40. });
  41. Object.defineProperty(SGradient.prototype, "y2", {
  42. get: function () {
  43. return this.end.y;
  44. },
  45. set: function (value) {
  46. this.end.y = value;
  47. },
  48. enumerable: false,
  49. configurable: true
  50. });
  51. SGradient.prototype.addColorStop = function (pos, color) {
  52. this.stopList.push(new _1.SGradientStop(pos, color));
  53. };
  54. SGradient.prototype.setStart = function (x, y) {
  55. this.start.x = x;
  56. this.start.y = y;
  57. };
  58. SGradient.prototype.setEnd = function (x, y) {
  59. this.end.x = x;
  60. this.end.y = y;
  61. };
  62. return SGradient;
  63. }());
  64. exports.SGradient = SGradient;