SPaintState.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.SPaintState = void 0;
  4. var __1 = require("..");
  5. var SCompositeType_1 = require("../enums/SCompositeType");
  6. var SShadow_1 = require("../SShadow");
  7. var base_1 = require("@saga-web/base");
  8. var SPaintState = (function () {
  9. function SPaintState(state) {
  10. this.matrix = new base_1.SMatrix();
  11. this._pen = new __1.SPen();
  12. this._brush = new __1.SBrush();
  13. this._font = new __1.SFont();
  14. this._composite = SCompositeType_1.SCompositeType.SourceOver;
  15. this._shadow = new SShadow_1.SShadow();
  16. if (state != undefined) {
  17. this.pen = new __1.SPen(state.pen);
  18. this.brush = new __1.SBrush(state.brush);
  19. this.font = new __1.SFont(state.font);
  20. this._composite = state._composite;
  21. this.shadow = new SShadow_1.SShadow(state.shadow);
  22. var m = new base_1.SMatrix();
  23. m.m11 = state.matrix.m11;
  24. m.m12 = state.matrix.m12;
  25. m.m13 = state.matrix.m13;
  26. m.m14 = state.matrix.m14;
  27. m.m21 = state.matrix.m21;
  28. m.m22 = state.matrix.m22;
  29. m.m23 = state.matrix.m23;
  30. m.m24 = state.matrix.m24;
  31. m.m31 = state.matrix.m31;
  32. m.m32 = state.matrix.m32;
  33. m.m33 = state.matrix.m33;
  34. m.m34 = state.matrix.m34;
  35. m.m41 = state.matrix.m41;
  36. m.m42 = state.matrix.m42;
  37. m.m43 = state.matrix.m43;
  38. m.m44 = state.matrix.m44;
  39. this.matrix = m;
  40. }
  41. }
  42. Object.defineProperty(SPaintState.prototype, "pen", {
  43. get: function () {
  44. return this._pen;
  45. },
  46. set: function (value) {
  47. this._pen = value;
  48. },
  49. enumerable: false,
  50. configurable: true
  51. });
  52. Object.defineProperty(SPaintState.prototype, "brush", {
  53. get: function () {
  54. return this._brush;
  55. },
  56. set: function (value) {
  57. this._brush = value;
  58. },
  59. enumerable: false,
  60. configurable: true
  61. });
  62. Object.defineProperty(SPaintState.prototype, "font", {
  63. get: function () {
  64. return this._font;
  65. },
  66. set: function (value) {
  67. this._font = value;
  68. },
  69. enumerable: false,
  70. configurable: true
  71. });
  72. Object.defineProperty(SPaintState.prototype, "shadow", {
  73. get: function () {
  74. return this._shadow;
  75. },
  76. set: function (v) {
  77. this._shadow = v;
  78. },
  79. enumerable: false,
  80. configurable: true
  81. });
  82. return SPaintState;
  83. }());
  84. exports.SPaintState = SPaintState;