SPen.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.SPen = void 0;
  4. var _1 = require("./");
  5. var SPen = (function () {
  6. function SPen(color, lineWidth) {
  7. this.color = _1.SColor.Black;
  8. this.lineWidth = 1;
  9. this.lineCapStyle = _1.SLineCapStyle.Butt;
  10. this.lineJoinStyle = _1.SLineJoinStyle.Miter;
  11. this.miterLimit = 10;
  12. this.lineDash = null;
  13. this.dashOffset = 0;
  14. if (color == undefined) {
  15. return;
  16. }
  17. if (color instanceof SPen) {
  18. this.color = new _1.SColor(color.color);
  19. this.lineWidth = color.lineWidth;
  20. this.lineCapStyle = color.lineCapStyle;
  21. this.lineJoinStyle = color.lineJoinStyle;
  22. this.miterLimit = color.miterLimit;
  23. this.dashOffset = color.dashOffset;
  24. this.lineDash =
  25. color.lineDash != null ? color.lineDash.slice() : null;
  26. }
  27. else {
  28. this.color = new _1.SColor(color);
  29. this.lineWidth = lineWidth != undefined ? lineWidth : 1;
  30. }
  31. }
  32. return SPen;
  33. }());
  34. exports.SPen = SPen;