@pixldocs/canvas-renderer 0.5.107 → 0.5.108

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.
package/dist/index.js CHANGED
@@ -17307,24 +17307,19 @@ async function convertTextDecorationsToLines(svg) {
17307
17307
  if (liveTspan) {
17308
17308
  try {
17309
17309
  const liveCharCount = liveTspan.getNumberOfChars();
17310
- const svgWidth = liveTspan.getComputedTextLength();
17311
- if (Number.isFinite(svgWidth) && svgWidth > 0) {
17312
- textWidth = Math.max(textWidth, svgWidth);
17313
- }
17314
17310
  if (liveCharCount > 0) {
17315
17311
  const start = liveTspan.getStartPositionOfChar(0);
17316
17312
  const end = liveTspan.getEndPositionOfChar(liveCharCount - 1);
17317
17313
  if (Number.isFinite(start.x)) lineStartX = start.x;
17318
17314
  if (Number.isFinite(start.y)) baselineY = start.y;
17319
- if (Number.isFinite(end.x)) lineEndX = Math.max(end.x, lineStartX + textWidth);
17315
+ if (Number.isFinite(end.x)) lineEndX = end.x;
17320
17316
  if (Number.isFinite(end.y) && !Number.isFinite(baselineY)) baselineY = end.y;
17321
17317
  } else {
17322
- lineEndX = lineStartX + textWidth;
17323
- }
17324
- const bbox = liveTspan.getBBox();
17325
- if (Number.isFinite(bbox.x) && Number.isFinite(bbox.width)) {
17326
- lineStartX = Math.min(lineStartX, bbox.x);
17327
- lineEndX = Math.max(lineEndX, bbox.x + bbox.width);
17318
+ const svgWidth = liveTspan.getComputedTextLength();
17319
+ if (Number.isFinite(svgWidth) && svgWidth > 0) {
17320
+ textWidth = svgWidth;
17321
+ lineEndX = lineStartX + textWidth;
17322
+ }
17328
17323
  }
17329
17324
  } catch {
17330
17325
  }