@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.cjs +6 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -17326,24 +17326,19 @@ async function convertTextDecorationsToLines(svg) {
|
|
|
17326
17326
|
if (liveTspan) {
|
|
17327
17327
|
try {
|
|
17328
17328
|
const liveCharCount = liveTspan.getNumberOfChars();
|
|
17329
|
-
const svgWidth = liveTspan.getComputedTextLength();
|
|
17330
|
-
if (Number.isFinite(svgWidth) && svgWidth > 0) {
|
|
17331
|
-
textWidth = Math.max(textWidth, svgWidth);
|
|
17332
|
-
}
|
|
17333
17329
|
if (liveCharCount > 0) {
|
|
17334
17330
|
const start = liveTspan.getStartPositionOfChar(0);
|
|
17335
17331
|
const end = liveTspan.getEndPositionOfChar(liveCharCount - 1);
|
|
17336
17332
|
if (Number.isFinite(start.x)) lineStartX = start.x;
|
|
17337
17333
|
if (Number.isFinite(start.y)) baselineY = start.y;
|
|
17338
|
-
if (Number.isFinite(end.x)) lineEndX =
|
|
17334
|
+
if (Number.isFinite(end.x)) lineEndX = end.x;
|
|
17339
17335
|
if (Number.isFinite(end.y) && !Number.isFinite(baselineY)) baselineY = end.y;
|
|
17340
17336
|
} else {
|
|
17341
|
-
|
|
17342
|
-
|
|
17343
|
-
|
|
17344
|
-
|
|
17345
|
-
|
|
17346
|
-
lineEndX = Math.max(lineEndX, bbox.x + bbox.width);
|
|
17337
|
+
const svgWidth = liveTspan.getComputedTextLength();
|
|
17338
|
+
if (Number.isFinite(svgWidth) && svgWidth > 0) {
|
|
17339
|
+
textWidth = svgWidth;
|
|
17340
|
+
lineEndX = lineStartX + textWidth;
|
|
17341
|
+
}
|
|
17347
17342
|
}
|
|
17348
17343
|
} catch {
|
|
17349
17344
|
}
|