@pixldocs/canvas-renderer 0.5.48 → 0.5.50
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 +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4945,7 +4945,7 @@ function applyTextBackground(obj, cfg) {
|
|
|
4945
4945
|
const oy = Number(shadow.offsetY ?? 0) || 0;
|
|
4946
4946
|
const blur = Math.max(0, Number(shadow.blur ?? 0));
|
|
4947
4947
|
const shadowColor = String(shadow.color);
|
|
4948
|
-
const pad = Math.max(
|
|
4948
|
+
const pad = Math.max(16, Math.ceil(blur * 4) + Math.ceil(Math.max(Math.abs(ox), Math.abs(oy))) + 8);
|
|
4949
4949
|
const bx = -w / 2 - pL - pad;
|
|
4950
4950
|
const by = -h / 2 - pT - pad;
|
|
4951
4951
|
const bw = w + pL + pR + pad * 2;
|
|
@@ -12340,7 +12340,7 @@ function PixldocsPreview(props) {
|
|
|
12340
12340
|
!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..." }) })
|
|
12341
12341
|
] });
|
|
12342
12342
|
}
|
|
12343
|
-
const PACKAGE_VERSION = "0.5.
|
|
12343
|
+
const PACKAGE_VERSION = "0.5.50";
|
|
12344
12344
|
let __underlineFixInstalled = false;
|
|
12345
12345
|
function installUnderlineFix(fab) {
|
|
12346
12346
|
var _a;
|
|
@@ -15038,7 +15038,7 @@ async function rasterizeShadowMarkers(svg) {
|
|
|
15038
15038
|
const stdDev = Math.max(0, blur);
|
|
15039
15039
|
const filterId = `pdShadowBlur_${Math.random().toString(36).slice(2, 9)}`;
|
|
15040
15040
|
const styleBlock = fontFaceCss ? `<style>${fontFaceCss}</style>` : "";
|
|
15041
|
-
const miniSvg = `<svg xmlns="${SVG_NS}" xmlns:xlink="${XLINK_NS}" width="${pxW}" height="${pxH}" viewBox="${bx} ${by} ${bw} ${bh}"
|
|
15041
|
+
const miniSvg = `<svg xmlns="${SVG_NS}" xmlns:xlink="${XLINK_NS}" width="${pxW}" height="${pxH}" viewBox="${bx} ${by} ${bw} ${bh}">${styleBlock}<defs><filter id="${filterId}" filterUnits="userSpaceOnUse" x="${bx}" y="${by}" width="${bw}" height="${bh}" color-interpolation-filters="sRGB"><feOffset dx="${ox}" dy="${oy}" result="offsetShadow" /><feGaussianBlur in="offsetShadow" stdDeviation="${stdDev}" /></filter></defs><g filter="url(#${filterId})">${innerXml}</g></svg>`;
|
|
15042
15042
|
const dataUrl = await rasterSvgToPngDataUrl(miniSvg, pxW, pxH);
|
|
15043
15043
|
if (!dataUrl) {
|
|
15044
15044
|
(_c = marker.parentNode) == null ? void 0 : _c.removeChild(marker);
|