@pixldocs/canvas-renderer 0.5.80 → 0.5.81
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 +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -12609,7 +12609,7 @@ function PixldocsPreview(props) {
|
|
|
12609
12609
|
!canvasSettled && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", minHeight: 200 }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: "#888", fontSize: 14 }, children: "Loading preview..." }) })
|
|
12610
12610
|
] });
|
|
12611
12611
|
}
|
|
12612
|
-
const PACKAGE_VERSION = "0.5.
|
|
12612
|
+
const PACKAGE_VERSION = "0.5.81";
|
|
12613
12613
|
const roundParityValue = (value) => {
|
|
12614
12614
|
if (typeof value !== "number") return value;
|
|
12615
12615
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -15454,7 +15454,9 @@ async function convertTextDecorationsToLines(svg) {
|
|
|
15454
15454
|
const fontFamily = tspan.getAttribute("data-source-font-family") || textEl.getAttribute("data-source-font-family") || resolveInheritedSvgValue(tspan, "font-family") || "sans-serif";
|
|
15455
15455
|
const fontWeight = tspan.getAttribute("data-source-font-weight") || textEl.getAttribute("data-source-font-weight") || resolveInheritedSvgValue(tspan, "font-weight") || "normal";
|
|
15456
15456
|
const fontStyle = tspan.getAttribute("data-source-font-style") || textEl.getAttribute("data-source-font-style") || resolveInheritedSvgValue(tspan, "font-style") || "normal";
|
|
15457
|
-
const
|
|
15457
|
+
const resolvedFill = tspan.getAttribute("fill") || getInlineStyleValue(tspan, "fill") || resolveInheritedSvgValue(tspan, "fill") || textEl.getAttribute("fill") || getInlineStyleValue(textEl, "fill") || "#000000";
|
|
15458
|
+
const fill = resolvedFill;
|
|
15459
|
+
const fillOpacity = tspan.getAttribute("fill-opacity") || getInlineStyleValue(tspan, "fill-opacity") || resolveInheritedSvgValue(tspan, "fill-opacity") || textEl.getAttribute("fill-opacity") || getInlineStyleValue(textEl, "fill-opacity") || null;
|
|
15458
15460
|
let textWidth = content.length * fontSize * 0.6;
|
|
15459
15461
|
if (ctx) {
|
|
15460
15462
|
ctx.font = `${fontStyle} ${fontWeight} ${fontSize}px ${fontFamily.replace(/'/g, "")}`;
|
|
@@ -15505,6 +15507,7 @@ async function convertTextDecorationsToLines(svg) {
|
|
|
15505
15507
|
line.setAttribute("stroke-width", String(thickness));
|
|
15506
15508
|
line.setAttribute("stroke-linecap", "butt");
|
|
15507
15509
|
line.setAttribute("fill", "none");
|
|
15510
|
+
if (fillOpacity) line.setAttribute("stroke-opacity", fillOpacity);
|
|
15508
15511
|
if (textEl.parentElement) {
|
|
15509
15512
|
textEl.parentElement.insertBefore(line, textEl.nextSibling);
|
|
15510
15513
|
}
|