html2canvas-pro 1.5.7 → 1.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * undefined 1.5.7 <https://yorickshan.github.io/html2canvas-pro/>
2
+ * html2canvas-pro 1.5.8 <https://yorickshan.github.io/html2canvas-pro/>
3
3
  * Copyright (c) 2024 yorickshan <https://github.com/yorickshan>
4
4
  * Released under MIT License
5
5
  */
@@ -7600,15 +7600,14 @@
7600
7600
  };
7601
7601
  CanvasRenderer.prototype.renderTextNode = function (text, styles) {
7602
7602
  return __awaiter(this, void 0, void 0, function () {
7603
- var _a, font, fontFamily, fontSize, baseline, paintOrder;
7603
+ var font, paintOrder;
7604
7604
  var _this = this;
7605
- return __generator(this, function (_b) {
7606
- _a = this.createFontStyle(styles), font = _a[0], fontFamily = _a[1], fontSize = _a[2];
7605
+ return __generator(this, function (_a) {
7606
+ font = this.createFontStyle(styles)[0];
7607
7607
  this.ctx.font = font;
7608
7608
  this.ctx.direction = styles.direction === 1 /* DIRECTION.RTL */ ? 'rtl' : 'ltr';
7609
7609
  this.ctx.textAlign = 'left';
7610
7610
  this.ctx.textBaseline = 'alphabetic';
7611
- baseline = this.fontMetrics.getMetrics(fontFamily, fontSize).baseline;
7612
7611
  paintOrder = styles.paintOrder;
7613
7612
  text.textBounds.forEach(function (text) {
7614
7613
  paintOrder.forEach(function (paintOrderLayer) {
@@ -7658,7 +7657,7 @@
7658
7657
  _this.ctx.lineWidth = styles.webkitTextStrokeWidth;
7659
7658
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
7660
7659
  _this.ctx.lineJoin = !!window.chrome ? 'miter' : 'round';
7661
- _this.ctx.strokeText(text.text, text.bounds.left, text.bounds.top + baseline);
7660
+ _this.ctx.strokeText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
7662
7661
  }
7663
7662
  _this.ctx.strokeStyle = '';
7664
7663
  _this.ctx.lineWidth = 0;