@pixldocs/canvas-renderer 0.5.438 → 0.5.440
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-BIvYSBXQ.js → index-H0u34DDY.js} +30 -10
- package/dist/index-H0u34DDY.js.map +1 -0
- package/dist/{index-BIAXZTHb.cjs → index-hWZ5kvhb.cjs} +30 -10
- package/dist/index-hWZ5kvhb.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-ddzCO9sg.js → vectorPdfExport-BkFH66cH.js} +4 -4
- package/dist/{vectorPdfExport-ddzCO9sg.js.map → vectorPdfExport-BkFH66cH.js.map} +1 -1
- package/dist/{vectorPdfExport-DW6SkA07.cjs → vectorPdfExport-CtvA0Dck.cjs} +4 -4
- package/dist/{vectorPdfExport-DW6SkA07.cjs.map → vectorPdfExport-CtvA0Dck.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-BIAXZTHb.cjs.map +0 -1
- package/dist/index-BIvYSBXQ.js.map +0 -1
|
@@ -11645,6 +11645,22 @@ const bakeTextboxScaleIntoTypography = (obj, sourceElement) => {
|
|
|
11645
11645
|
};
|
|
11646
11646
|
return updates;
|
|
11647
11647
|
};
|
|
11648
|
+
const applyTransformPreservingFlip = (obj, matrix) => {
|
|
11649
|
+
fabric.util.applyTransformToObject(obj, matrix);
|
|
11650
|
+
let sx = obj.scaleX ?? 1;
|
|
11651
|
+
let sy = obj.scaleY ?? 1;
|
|
11652
|
+
let flipX = false;
|
|
11653
|
+
let flipY = false;
|
|
11654
|
+
if (sx < 0) {
|
|
11655
|
+
flipX = true;
|
|
11656
|
+
sx = -sx;
|
|
11657
|
+
}
|
|
11658
|
+
if (sy < 0) {
|
|
11659
|
+
flipY = true;
|
|
11660
|
+
sy = -sy;
|
|
11661
|
+
}
|
|
11662
|
+
obj.set({ scaleX: sx, scaleY: sy, flipX, flipY });
|
|
11663
|
+
};
|
|
11648
11664
|
function applyWarpAwareSelectionBorders(selection) {
|
|
11649
11665
|
var _a2;
|
|
11650
11666
|
if (selection.__pixldocsOrigASHasBorders !== void 0) {
|
|
@@ -11742,7 +11758,7 @@ function applyWarpAwareSelectionBorders(selection) {
|
|
|
11742
11758
|
const savedLayout = k.layoutManager;
|
|
11743
11759
|
try {
|
|
11744
11760
|
if (savedLayout) k.layoutManager = void 0;
|
|
11745
|
-
|
|
11761
|
+
applyTransformPreservingFlip(k, localMatrix);
|
|
11746
11762
|
const decomposed = fabric.util.qrDecompose(
|
|
11747
11763
|
localMatrix
|
|
11748
11764
|
);
|
|
@@ -15123,7 +15139,7 @@ const PageCanvas = forwardRef(
|
|
|
15123
15139
|
const normalizedScaleAngle = ((obj.angle ?? 0) % 360 + 360) % 360;
|
|
15124
15140
|
const isRotatedActiveSelectionCorner = obj instanceof fabric.ActiveSelection && isCornerResizeHandle(corner) && Math.min(normalizedScaleAngle, 360 - normalizedScaleAngle) > 0.5;
|
|
15125
15141
|
const isRotatedActiveSelectionSide = obj instanceof fabric.ActiveSelection && (corner === "mt" || corner === "mb" || corner === "ml" || corner === "mr") && Math.min(normalizedScaleAngle, 360 - normalizedScaleAngle) > 0.5;
|
|
15126
|
-
const isRotatedSingleObjectScale = !(obj instanceof fabric.ActiveSelection) && isCornerResizeHandle(corner) && Math.min(normalizedScaleAngle, 360 - normalizedScaleAngle) > 0.5;
|
|
15142
|
+
const isRotatedSingleObjectScale = !(obj instanceof fabric.ActiveSelection) && (isCornerResizeHandle(corner) || corner === "mt" || corner === "mb" || corner === "ml" || corner === "mr") && Math.min(normalizedScaleAngle, 360 - normalizedScaleAngle) > 0.5;
|
|
15127
15143
|
if (!isRotatedActiveSelectionCorner && !isRotatedActiveSelectionSide && !isRotatedSingleObjectScale) {
|
|
15128
15144
|
snapDuringScaleCallback(obj, corner);
|
|
15129
15145
|
}
|
|
@@ -15248,8 +15264,12 @@ const PageCanvas = forwardRef(
|
|
|
15248
15264
|
const sourceEl = objId ? elementsRef.current.find((el) => el.id === objId) : void 0;
|
|
15249
15265
|
bakeTextboxScaleIntoTypography(obj, sourceEl);
|
|
15250
15266
|
}
|
|
15251
|
-
|
|
15252
|
-
const
|
|
15267
|
+
const normResizeAngle = ((obj.angle ?? 0) % 360 + 360) % 360;
|
|
15268
|
+
const isRotatedSingleResize = !(obj instanceof fabric.ActiveSelection) && Math.min(normResizeAngle, 360 - normResizeAngle) > 0.5;
|
|
15269
|
+
if (!isRotatedSingleResize) {
|
|
15270
|
+
snapDuringScaleCallback(obj, corner);
|
|
15271
|
+
}
|
|
15272
|
+
const scaleGuides = isRotatedSingleResize ? [] : calculateScaleSnapGuidesCallback(obj, corner);
|
|
15253
15273
|
const gridGuidesForTextResize = [];
|
|
15254
15274
|
try {
|
|
15255
15275
|
const psGrid = projectSettingsRef.current;
|
|
@@ -16771,7 +16791,7 @@ const PageCanvas = forwardRef(
|
|
|
16771
16791
|
if (!objId || objId === "__background__") continue;
|
|
16772
16792
|
const objOwnMatrix = obj.calcOwnMatrix();
|
|
16773
16793
|
const absoluteMatrix = fabric.util.multiplyTransformMatrices(selectionMatrix, objOwnMatrix);
|
|
16774
|
-
|
|
16794
|
+
applyTransformPreservingFlip(obj, absoluteMatrix);
|
|
16775
16795
|
obj.setCoords();
|
|
16776
16796
|
}
|
|
16777
16797
|
});
|
|
@@ -25831,9 +25851,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
25831
25851
|
}
|
|
25832
25852
|
return svgString;
|
|
25833
25853
|
}
|
|
25834
|
-
const resolvedPackageVersion = "0.5.
|
|
25854
|
+
const resolvedPackageVersion = "0.5.440";
|
|
25835
25855
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
25836
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
25856
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.440";
|
|
25837
25857
|
const roundParityValue = (value) => {
|
|
25838
25858
|
if (typeof value !== "number") return value;
|
|
25839
25859
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -26647,7 +26667,7 @@ class PixldocsRenderer {
|
|
|
26647
26667
|
await this.waitForCanvasScene(container, cloned, i);
|
|
26648
26668
|
}
|
|
26649
26669
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
26650
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
26670
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BkFH66cH.js");
|
|
26651
26671
|
const prepared = preparePagesForExport(
|
|
26652
26672
|
cloned.pages,
|
|
26653
26673
|
canvasWidth,
|
|
@@ -28967,7 +28987,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
28967
28987
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
28968
28988
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
28969
28989
|
try {
|
|
28970
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
28990
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BkFH66cH.js");
|
|
28971
28991
|
try {
|
|
28972
28992
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
28973
28993
|
} catch {
|
|
@@ -29367,4 +29387,4 @@ export {
|
|
|
29367
29387
|
buildTeaserBlurFlatKeys as y,
|
|
29368
29388
|
collectFontDescriptorsFromConfig as z
|
|
29369
29389
|
};
|
|
29370
|
-
//# sourceMappingURL=index-
|
|
29390
|
+
//# sourceMappingURL=index-H0u34DDY.js.map
|