@pixldocs/canvas-renderer 0.5.329 → 0.5.331
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-K53gPk1O.js → index-C9n6xrCt.js} +125 -41
- package/dist/index-C9n6xrCt.js.map +1 -0
- package/dist/{index-_B1EJq7R.cjs → index-COZR9zOa.cjs} +125 -41
- package/dist/index-COZR9zOa.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-DNaP0TIk.cjs → vectorPdfExport-07IeD7w3.cjs} +4 -4
- package/dist/{vectorPdfExport-DNaP0TIk.cjs.map → vectorPdfExport-07IeD7w3.cjs.map} +1 -1
- package/dist/{vectorPdfExport-BhmhaCT1.js → vectorPdfExport-DvpRTaGb.js} +4 -4
- package/dist/{vectorPdfExport-BhmhaCT1.js.map → vectorPdfExport-DvpRTaGb.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-K53gPk1O.js.map +0 -1
- package/dist/index-_B1EJq7R.cjs.map +0 -1
|
@@ -11178,6 +11178,15 @@ const bakeTextboxScaleIntoTypography = (obj, sourceElement) => {
|
|
|
11178
11178
|
};
|
|
11179
11179
|
return updates;
|
|
11180
11180
|
};
|
|
11181
|
+
const rotatedTopLeftToCenter = (left, top, width, height, angleDeg = 0) => {
|
|
11182
|
+
const angle = angleDeg * Math.PI / 180;
|
|
11183
|
+
const cos = Math.cos(angle);
|
|
11184
|
+
const sin = Math.sin(angle);
|
|
11185
|
+
return {
|
|
11186
|
+
x: left + width / 2 * cos - height / 2 * sin,
|
|
11187
|
+
y: top + width / 2 * sin + height / 2 * cos
|
|
11188
|
+
};
|
|
11189
|
+
};
|
|
11181
11190
|
function applyWarpAwareSelectionBorders(selection) {
|
|
11182
11191
|
var _a2;
|
|
11183
11192
|
if (selection.__pixldocsOrigASHasBorders !== void 0) {
|
|
@@ -13540,29 +13549,23 @@ const PageCanvas = react.forwardRef(
|
|
|
13540
13549
|
const getObjectFrameBoundsInSelection = (selection, obj, frameWidth, frameHeight) => {
|
|
13541
13550
|
const w = Math.max(1, frameWidth ?? obj.width ?? 1);
|
|
13542
13551
|
const h = Math.max(1, frameHeight ?? obj.height ?? 1);
|
|
13543
|
-
const originX = obj.originX ?? "left";
|
|
13544
|
-
const originY = obj.originY ?? "top";
|
|
13545
|
-
const localLeft = originX === "center" ? -w / 2 : originX === "right" ? -w : 0;
|
|
13546
|
-
const localTop = originY === "center" ? -h / 2 : originY === "bottom" ? -h : 0;
|
|
13547
13552
|
const matrix = fabric__namespace.util.multiplyTransformMatrices(
|
|
13548
13553
|
selection.calcTransformMatrix(),
|
|
13549
13554
|
obj.calcOwnMatrix()
|
|
13550
13555
|
);
|
|
13551
|
-
const
|
|
13552
|
-
|
|
13553
|
-
|
|
13554
|
-
|
|
13555
|
-
|
|
13556
|
-
|
|
13557
|
-
const
|
|
13558
|
-
const
|
|
13559
|
-
const left = Math.min(...xs);
|
|
13560
|
-
const top = Math.min(...ys);
|
|
13556
|
+
const decomposed = fabric__namespace.util.qrDecompose(matrix);
|
|
13557
|
+
const scaledW = Math.max(1, w * Math.abs(decomposed.scaleX || 1));
|
|
13558
|
+
const scaledH = Math.max(1, h * Math.abs(decomposed.scaleY || 1));
|
|
13559
|
+
const angleRad = (decomposed.angle ?? 0) * Math.PI / 180;
|
|
13560
|
+
const cos = Math.cos(angleRad);
|
|
13561
|
+
const sin = Math.sin(angleRad);
|
|
13562
|
+
const left = decomposed.translateX - scaledW / 2 * cos + scaledH / 2 * sin;
|
|
13563
|
+
const top = decomposed.translateY - scaledW / 2 * sin - scaledH / 2 * cos;
|
|
13561
13564
|
return {
|
|
13562
13565
|
left,
|
|
13563
13566
|
top,
|
|
13564
|
-
width:
|
|
13565
|
-
height:
|
|
13567
|
+
width: scaledW,
|
|
13568
|
+
height: scaledH
|
|
13566
13569
|
};
|
|
13567
13570
|
};
|
|
13568
13571
|
fabricCanvas.on("object:added", (e) => {
|
|
@@ -13758,7 +13761,7 @@ const PageCanvas = react.forwardRef(
|
|
|
13758
13761
|
const a = ((c.angle ?? 0) % 180 + 180) % 180;
|
|
13759
13762
|
return !(a < 0.5 || a > 179.5);
|
|
13760
13763
|
});
|
|
13761
|
-
if (isXSide && ((_b2 = groupShiftReflowSnapshotRef.current) == null ? void 0 : _b2.selection) !== obj) {
|
|
13764
|
+
if ((isXSide || hasRotatedChild) && ((_b2 = groupShiftReflowSnapshotRef.current) == null ? void 0 : _b2.selection) !== obj) {
|
|
13762
13765
|
groupShiftReflowSnapshotRef.current = null;
|
|
13763
13766
|
const logicalGroupId = obj.__pixldocsGroupSelection;
|
|
13764
13767
|
if (logicalGroupId) {
|
|
@@ -13770,7 +13773,9 @@ const PageCanvas = react.forwardRef(
|
|
|
13770
13773
|
const entries = obj.getObjects().map((c) => ({
|
|
13771
13774
|
obj: c,
|
|
13772
13775
|
id: getObjectId(c) ?? "",
|
|
13776
|
+
left0: c.left ?? 0,
|
|
13773
13777
|
top0: c.top ?? 0,
|
|
13778
|
+
width0: (c.width ?? 0) * Math.abs(c.scaleX ?? 1),
|
|
13774
13779
|
height0: (c.height ?? 0) * Math.abs(c.scaleY ?? 1)
|
|
13775
13780
|
})).filter((e2) => e2.id).sort((a, b) => a.top0 - b.top0);
|
|
13776
13781
|
if (entries.length > 1) {
|
|
@@ -13803,22 +13808,87 @@ const PageCanvas = react.forwardRef(
|
|
|
13803
13808
|
}
|
|
13804
13809
|
}
|
|
13805
13810
|
const childCounterScale = hasRotatedChild ? 1 : 1 / sAxis;
|
|
13811
|
+
const restoreNonTextChildren = (pins) => {
|
|
13812
|
+
var _a3, _b3;
|
|
13813
|
+
if (!hasRotatedChild || ((_a3 = groupShiftReflowSnapshotRef.current) == null ? void 0 : _a3.selection) !== obj) return;
|
|
13814
|
+
for (const entry of groupShiftReflowSnapshotRef.current.children) {
|
|
13815
|
+
const child = entry.obj;
|
|
13816
|
+
if (child instanceof fabric__namespace.Textbox) continue;
|
|
13817
|
+
if (child instanceof fabric__namespace.FabricImage || child instanceof fabric__namespace.Group && (child.__cropGroup || ((_b3 = child._ct) == null ? void 0 : _b3.isCropGroup))) {
|
|
13818
|
+
const pin = pins == null ? void 0 : pins.get(child);
|
|
13819
|
+
const targetLeft = (pin == null ? void 0 : pin.left) ?? (isXSide ? entry.left0 * sAxis : entry.left0);
|
|
13820
|
+
const targetTop = (pin == null ? void 0 : pin.top) ?? (isXSide ? entry.top0 : entry.top0 * sAxis);
|
|
13821
|
+
if (Math.abs((child.left ?? 0) - targetLeft) > 0.01) child._set("left", targetLeft);
|
|
13822
|
+
if (Math.abs((child.top ?? 0) - targetTop) > 0.01) child._set("top", targetTop);
|
|
13823
|
+
if (isXSide) child._set("scaleX", childCounterScale);
|
|
13824
|
+
else child._set("scaleY", childCounterScale);
|
|
13825
|
+
child.setCoords();
|
|
13826
|
+
child.dirty = true;
|
|
13827
|
+
}
|
|
13828
|
+
}
|
|
13829
|
+
};
|
|
13830
|
+
const projectRotatedTextPosition = (child) => {
|
|
13831
|
+
var _a3;
|
|
13832
|
+
if (!hasRotatedChild || ((_a3 = groupShiftReflowSnapshotRef.current) == null ? void 0 : _a3.selection) !== obj) return;
|
|
13833
|
+
const entry = groupShiftReflowSnapshotRef.current.children.find((candidate) => candidate.obj === child);
|
|
13834
|
+
if (!entry) return;
|
|
13835
|
+
if (isXSide) child._set("left", entry.left0 * sAxis);
|
|
13836
|
+
else child._set("top", entry.top0 * sAxis);
|
|
13837
|
+
};
|
|
13806
13838
|
for (const child of obj.getObjects()) {
|
|
13807
13839
|
if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_d = child._ct) == null ? void 0 : _d.isCropGroup))) {
|
|
13840
|
+
const ct = child.__cropData;
|
|
13841
|
+
if (ct) {
|
|
13842
|
+
if (child.__asLiveOrigW == null) {
|
|
13843
|
+
child.__asLiveOrigW = ct.frameW ?? child.width ?? 1;
|
|
13844
|
+
}
|
|
13845
|
+
if (child.__asLiveOrigH == null) {
|
|
13846
|
+
child.__asLiveOrigH = ct.frameH ?? child.height ?? 1;
|
|
13847
|
+
}
|
|
13848
|
+
if (isXSide) {
|
|
13849
|
+
const newW = Math.max(1, Number(child.__asLiveOrigW) * sAxis);
|
|
13850
|
+
ct.frameW = newW;
|
|
13851
|
+
child._set("width", newW);
|
|
13852
|
+
} else {
|
|
13853
|
+
const newH = Math.max(1, Number(child.__asLiveOrigH) * sAxis);
|
|
13854
|
+
ct.frameH = newH;
|
|
13855
|
+
child._set("height", newH);
|
|
13856
|
+
}
|
|
13857
|
+
try {
|
|
13858
|
+
updateCoverLayout(child);
|
|
13859
|
+
} catch {
|
|
13860
|
+
}
|
|
13861
|
+
}
|
|
13808
13862
|
if (isXSide) child._set("scaleX", childCounterScale);
|
|
13809
13863
|
else child._set("scaleY", childCounterScale);
|
|
13810
13864
|
child.setCoords();
|
|
13811
13865
|
child.dirty = true;
|
|
13866
|
+
didReflowTextChild = true;
|
|
13812
13867
|
continue;
|
|
13813
13868
|
}
|
|
13814
13869
|
if (child instanceof fabric__namespace.FabricImage && !child.__cropGroup && !child.smartElementType) {
|
|
13870
|
+
if (isXSide) {
|
|
13871
|
+
if (child.__asLiveOrigW == null) {
|
|
13872
|
+
child.__asLiveOrigW = (child.width ?? 0) * Math.abs(child.scaleX ?? 1);
|
|
13873
|
+
}
|
|
13874
|
+
const newW = Math.max(1, Number(child.__asLiveOrigW) * sAxis);
|
|
13875
|
+
child._set("width", newW);
|
|
13876
|
+
} else {
|
|
13877
|
+
if (child.__asLiveOrigH == null) {
|
|
13878
|
+
child.__asLiveOrigH = (child.height ?? 0) * Math.abs(child.scaleY ?? 1);
|
|
13879
|
+
}
|
|
13880
|
+
const newH = Math.max(1, Number(child.__asLiveOrigH) * sAxis);
|
|
13881
|
+
child._set("height", newH);
|
|
13882
|
+
}
|
|
13815
13883
|
if (isXSide) child._set("scaleX", childCounterScale);
|
|
13816
13884
|
else child._set("scaleY", childCounterScale);
|
|
13817
13885
|
child.setCoords();
|
|
13818
13886
|
child.dirty = true;
|
|
13887
|
+
didReflowTextChild = true;
|
|
13819
13888
|
continue;
|
|
13820
13889
|
}
|
|
13821
13890
|
if (!(child instanceof fabric__namespace.Textbox)) continue;
|
|
13891
|
+
projectRotatedTextPosition(child);
|
|
13822
13892
|
if (isXSide) {
|
|
13823
13893
|
if (child.__asLiveOrigW == null) {
|
|
13824
13894
|
child.__asLiveOrigW = (child.width ?? 0) * (child.scaleX ?? 1);
|
|
@@ -13886,10 +13956,12 @@ const PageCanvas = react.forwardRef(
|
|
|
13886
13956
|
if (cornersBefore) {
|
|
13887
13957
|
fixedMidBefore = corner === "ml" ? { x: (cornersBefore.tr.x + cornersBefore.br.x) / 2, y: (cornersBefore.tr.y + cornersBefore.br.y) / 2 } : { x: (cornersBefore.tl.x + cornersBefore.bl.x) / 2, y: (cornersBefore.tl.y + cornersBefore.bl.y) / 2 };
|
|
13888
13958
|
}
|
|
13959
|
+
const nonTextPinsBeforeLayout = hasRotatedChild ? new Map(obj.getObjects().map((child) => [child, { left: child.left ?? 0, top: child.top ?? 0 }])) : void 0;
|
|
13889
13960
|
try {
|
|
13890
13961
|
obj.triggerLayout();
|
|
13891
13962
|
} catch {
|
|
13892
13963
|
}
|
|
13964
|
+
restoreNonTextChildren(nonTextPinsBeforeLayout);
|
|
13893
13965
|
obj._set("width", asW0);
|
|
13894
13966
|
obj._set("scaleX", asSx0);
|
|
13895
13967
|
obj._set("scaleY", asSy0);
|
|
@@ -13915,6 +13987,7 @@ const PageCanvas = react.forwardRef(
|
|
|
13915
13987
|
obj._set("left", asLeft0);
|
|
13916
13988
|
obj._set("top", asTop0);
|
|
13917
13989
|
}
|
|
13990
|
+
restoreNonTextChildren();
|
|
13918
13991
|
obj._set("width", asW0);
|
|
13919
13992
|
obj._set("scaleX", asSx0);
|
|
13920
13993
|
obj._set("scaleY", asSy0);
|
|
@@ -14370,8 +14443,9 @@ const PageCanvas = react.forwardRef(
|
|
|
14370
14443
|
const stateCrop = useEditorStore.getState();
|
|
14371
14444
|
const pageCrop = stateCrop.canvas.pages.find((p) => p.id === pageId);
|
|
14372
14445
|
const pageChildrenCrop = (pageCrop == null ? void 0 : pageCrop.children) ?? [];
|
|
14373
|
-
const
|
|
14374
|
-
const
|
|
14446
|
+
const angleRad = (active.angle ?? 0) * Math.PI / 180;
|
|
14447
|
+
const absLeft = (active.left ?? 0) - ct.frameW / 2 * Math.cos(angleRad) + ct.frameH / 2 * Math.sin(angleRad);
|
|
14448
|
+
const absTop = (active.top ?? 0) - ct.frameW / 2 * Math.sin(angleRad) - ct.frameH / 2 * Math.cos(angleRad);
|
|
14375
14449
|
const storePosCrop = absoluteToStorePosition(absLeft, absTop, objId, pageChildrenCrop);
|
|
14376
14450
|
updateElement2(objId, {
|
|
14377
14451
|
width: ct.frameW,
|
|
@@ -14555,6 +14629,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14555
14629
|
return;
|
|
14556
14630
|
}
|
|
14557
14631
|
}
|
|
14632
|
+
const isActiveSelectionSideResize = isActiveSelection && (activeSelectionResizeHandle === "ml" || activeSelectionResizeHandle === "mr" || activeSelectionResizeHandle === "mt" || activeSelectionResizeHandle === "mb");
|
|
14558
14633
|
if (selectedElementIds.length > 0 && !anyCropGroup) {
|
|
14559
14634
|
const firstObj = activeObjects[0];
|
|
14560
14635
|
const firstId = getObjectId(firstObj);
|
|
@@ -14616,7 +14691,8 @@ const PageCanvas = react.forwardRef(
|
|
|
14616
14691
|
}
|
|
14617
14692
|
const deltaX = movedGroupLeft - groupAbs.left;
|
|
14618
14693
|
const deltaY = movedGroupTop - groupAbs.top;
|
|
14619
|
-
const
|
|
14694
|
+
const hadResizeHandle = isActiveSelection && !!activeSelectionResizeHandle;
|
|
14695
|
+
const hadScale = isActiveSelection && activeObj && (hadResizeHandle || Math.abs((activeObj.scaleX ?? 1) - 1) > 0.01 || Math.abs((activeObj.scaleY ?? 1) - 1) > 0.01);
|
|
14620
14696
|
const startSelAngle = (((transformStart == null ? void 0 : transformStart.selectionAngle) ?? 0) % 360 + 360) % 360;
|
|
14621
14697
|
const currentSelAngle = isActiveSelection && activeObj ? ((activeObj.angle ?? 0) % 360 + 360) % 360 : 0;
|
|
14622
14698
|
const angleDelta = Math.min(
|
|
@@ -14624,7 +14700,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14624
14700
|
360 - Math.abs(currentSelAngle - startSelAngle)
|
|
14625
14701
|
);
|
|
14626
14702
|
const hadRotation = isActiveSelection && activeObj && angleDelta > 0.01;
|
|
14627
|
-
if (!hadScale && !hadRotation && (Math.abs(deltaX) > 0.1 || Math.abs(deltaY) > 0.1)) {
|
|
14703
|
+
if (!isActiveSelectionSideResize && !hadScale && !hadRotation && (Math.abs(deltaX) > 0.1 || Math.abs(deltaY) > 0.1)) {
|
|
14628
14704
|
const { updateNode: updateNodeStore, commitHistory: commitHistoryStore, getCurrentElements } = useEditorStore.getState();
|
|
14629
14705
|
const newLeft = (groupToMove.left ?? 0) + deltaX;
|
|
14630
14706
|
const newTop = (groupToMove.top ?? 0) + deltaY;
|
|
@@ -14730,14 +14806,16 @@ const PageCanvas = react.forwardRef(
|
|
|
14730
14806
|
} else {
|
|
14731
14807
|
const w = ((ct == null ? void 0 : ct.frameW) ?? obj.width ?? 0) * Math.abs(obj.scaleX ?? 1);
|
|
14732
14808
|
const h = ((ct == null ? void 0 : ct.frameH) ?? obj.height ?? 0) * Math.abs(obj.scaleY ?? 1);
|
|
14733
|
-
|
|
14734
|
-
|
|
14809
|
+
const angleRad = (decomposed.angle ?? obj.angle ?? 0) * Math.PI / 180;
|
|
14810
|
+
absoluteLeft = (decomposed.translateX ?? absoluteLeft ?? 0) - w / 2 * Math.cos(angleRad) + h / 2 * Math.sin(angleRad);
|
|
14811
|
+
absoluteTop = (decomposed.translateY ?? absoluteTop ?? 0) - w / 2 * Math.sin(angleRad) - h / 2 * Math.cos(angleRad);
|
|
14735
14812
|
}
|
|
14736
14813
|
} else if (obj instanceof fabric__namespace.FabricImage && (obj.originX === "center" || obj.originY === "center")) {
|
|
14737
14814
|
const w = (obj.width ?? 0) * (obj.scaleX ?? 1);
|
|
14738
14815
|
const h = (obj.height ?? 0) * (obj.scaleY ?? 1);
|
|
14739
|
-
|
|
14740
|
-
|
|
14816
|
+
const angleRad = (decomposed.angle ?? obj.angle ?? 0) * Math.PI / 180;
|
|
14817
|
+
absoluteLeft = (decomposed.translateX ?? absoluteLeft ?? 0) - w / 2 * Math.cos(angleRad) + h / 2 * Math.sin(angleRad);
|
|
14818
|
+
absoluteTop = (decomposed.translateY ?? absoluteTop ?? 0) - w / 2 * Math.sin(angleRad) - h / 2 * Math.cos(angleRad);
|
|
14741
14819
|
}
|
|
14742
14820
|
const preserveCornerGeometry = (sourceElement == null ? void 0 : sourceElement.type) === "shape" && (sourceElement.shapeType === "circle" || sourceElement.shapeType === "rounded-rect" || sourceElement.shapeType === "triangle");
|
|
14743
14821
|
let finalWidth = intrinsicWidth;
|
|
@@ -14764,12 +14842,14 @@ const PageCanvas = react.forwardRef(
|
|
|
14764
14842
|
absoluteLeft = frameBounds.left;
|
|
14765
14843
|
absoluteTop = frameBounds.top;
|
|
14766
14844
|
} else {
|
|
14767
|
-
|
|
14768
|
-
|
|
14845
|
+
const angleRad = (decomposed.angle ?? obj.angle ?? 0) * Math.PI / 180;
|
|
14846
|
+
absoluteLeft = (decomposed.translateX ?? absoluteLeft) - finalWidth / 2 * Math.cos(angleRad) + finalHeight / 2 * Math.sin(angleRad);
|
|
14847
|
+
absoluteTop = (decomposed.translateY ?? absoluteTop) - finalWidth / 2 * Math.sin(angleRad) - finalHeight / 2 * Math.cos(angleRad);
|
|
14769
14848
|
}
|
|
14849
|
+
const finalCenter = rotatedTopLeftToCenter(absoluteLeft, absoluteTop, finalWidth, finalHeight, decomposed.angle ?? (obj.angle ?? 0));
|
|
14770
14850
|
finalAbsoluteMatrix = fabric__namespace.util.composeMatrix({
|
|
14771
|
-
translateX:
|
|
14772
|
-
translateY:
|
|
14851
|
+
translateX: finalCenter.x,
|
|
14852
|
+
translateY: finalCenter.y,
|
|
14773
14853
|
angle: decomposed.angle ?? (obj.angle ?? 0),
|
|
14774
14854
|
scaleX: 1,
|
|
14775
14855
|
scaleY: 1,
|
|
@@ -15155,9 +15235,10 @@ const PageCanvas = react.forwardRef(
|
|
|
15155
15235
|
if (!ct) continue;
|
|
15156
15236
|
ct.frameW = bake.width;
|
|
15157
15237
|
ct.frameH = bake.height;
|
|
15238
|
+
const bakeCenter = rotatedTopLeftToCenter(bake.left, bake.top, bake.width, bake.height, bake.angle);
|
|
15158
15239
|
bake.obj.set({
|
|
15159
|
-
left:
|
|
15160
|
-
top:
|
|
15240
|
+
left: bakeCenter.x,
|
|
15241
|
+
top: bakeCenter.y,
|
|
15161
15242
|
width: bake.width,
|
|
15162
15243
|
height: bake.height,
|
|
15163
15244
|
scaleX: 1,
|
|
@@ -15754,8 +15835,9 @@ const PageCanvas = react.forwardRef(
|
|
|
15754
15835
|
const node = findNodeById(pageChildren, element.id);
|
|
15755
15836
|
return node ? getAbsoluteBounds(node, pageChildren) : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15756
15837
|
})() : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15757
|
-
const
|
|
15758
|
-
const
|
|
15838
|
+
const cropCenter = rotatedTopLeftToCenter(cropPos.left, cropPos.top, ct.frameW ?? 0, ct.frameH ?? 0, element.angle ?? 0);
|
|
15839
|
+
const cropCenterX = cropCenter.x;
|
|
15840
|
+
const cropCenterY = cropCenter.y;
|
|
15759
15841
|
if (element.left !== void 0) existingObj.set({ left: cropCenterX });
|
|
15760
15842
|
if (element.top !== void 0) existingObj.set({ top: cropCenterY });
|
|
15761
15843
|
if (element.angle !== void 0) existingObj.set({ angle: element.angle });
|
|
@@ -16691,8 +16773,9 @@ const PageCanvas = react.forwardRef(
|
|
|
16691
16773
|
ct.shape = clipShape === "circle" ? "circle" : clipShape === "rounded" ? "roundRect" : "rect";
|
|
16692
16774
|
ct.rx = rxRatio;
|
|
16693
16775
|
obj.__maintainResolution = element.maintainResolution !== false;
|
|
16694
|
-
const
|
|
16695
|
-
const
|
|
16776
|
+
const center = rotatedTopLeftToCenter(fabricPos.left, fabricPos.top, elementWidth, elementHeight, element.angle ?? 0);
|
|
16777
|
+
const centerX = center.x;
|
|
16778
|
+
const centerY = center.y;
|
|
16696
16779
|
const cropSetProps = {
|
|
16697
16780
|
width: elementWidth,
|
|
16698
16781
|
height: elementHeight,
|
|
@@ -16932,7 +17015,8 @@ const PageCanvas = react.forwardRef(
|
|
|
16932
17015
|
if (!skipPositionUpdate && (obj instanceof fabric__namespace.FabricImage && obj.originX === "center" || obj instanceof fabric__namespace.Group && obj.__cropGroup)) {
|
|
16933
17016
|
const vW = rW * effectiveScaleX;
|
|
16934
17017
|
const vH = rH * effectiveScaleY;
|
|
16935
|
-
|
|
17018
|
+
const center = rotatedTopLeftToCenter(fabricPos.left, fabricPos.top, vW, vH, element.angle ?? 0);
|
|
17019
|
+
posIfNotSkipped = { left: center.x, top: center.y };
|
|
16936
17020
|
}
|
|
16937
17021
|
if (element.transformMatrix && element.transformMatrix.length === 6) {
|
|
16938
17022
|
if (isTextbox) {
|
|
@@ -24230,9 +24314,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24230
24314
|
}
|
|
24231
24315
|
return svgString;
|
|
24232
24316
|
}
|
|
24233
|
-
const resolvedPackageVersion = "0.5.
|
|
24317
|
+
const resolvedPackageVersion = "0.5.331";
|
|
24234
24318
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24235
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24319
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.331";
|
|
24236
24320
|
const roundParityValue = (value) => {
|
|
24237
24321
|
if (typeof value !== "number") return value;
|
|
24238
24322
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25046,7 +25130,7 @@ class PixldocsRenderer {
|
|
|
25046
25130
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25047
25131
|
}
|
|
25048
25132
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25049
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
25133
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-07IeD7w3.cjs"));
|
|
25050
25134
|
const prepared = preparePagesForExport(
|
|
25051
25135
|
cloned.pages,
|
|
25052
25136
|
canvasWidth,
|
|
@@ -27366,7 +27450,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27366
27450
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27367
27451
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27368
27452
|
try {
|
|
27369
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
27453
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-07IeD7w3.cjs"));
|
|
27370
27454
|
try {
|
|
27371
27455
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27372
27456
|
} catch {
|
|
@@ -27763,4 +27847,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
27763
27847
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
27764
27848
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
27765
27849
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
27766
|
-
//# sourceMappingURL=index-
|
|
27850
|
+
//# sourceMappingURL=index-COZR9zOa.cjs.map
|