@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
|
@@ -11160,6 +11160,15 @@ const bakeTextboxScaleIntoTypography = (obj, sourceElement) => {
|
|
|
11160
11160
|
};
|
|
11161
11161
|
return updates;
|
|
11162
11162
|
};
|
|
11163
|
+
const rotatedTopLeftToCenter = (left, top, width, height, angleDeg = 0) => {
|
|
11164
|
+
const angle = angleDeg * Math.PI / 180;
|
|
11165
|
+
const cos = Math.cos(angle);
|
|
11166
|
+
const sin = Math.sin(angle);
|
|
11167
|
+
return {
|
|
11168
|
+
x: left + width / 2 * cos - height / 2 * sin,
|
|
11169
|
+
y: top + width / 2 * sin + height / 2 * cos
|
|
11170
|
+
};
|
|
11171
|
+
};
|
|
11163
11172
|
function applyWarpAwareSelectionBorders(selection) {
|
|
11164
11173
|
var _a2;
|
|
11165
11174
|
if (selection.__pixldocsOrigASHasBorders !== void 0) {
|
|
@@ -13522,29 +13531,23 @@ const PageCanvas = forwardRef(
|
|
|
13522
13531
|
const getObjectFrameBoundsInSelection = (selection, obj, frameWidth, frameHeight) => {
|
|
13523
13532
|
const w = Math.max(1, frameWidth ?? obj.width ?? 1);
|
|
13524
13533
|
const h = Math.max(1, frameHeight ?? obj.height ?? 1);
|
|
13525
|
-
const originX = obj.originX ?? "left";
|
|
13526
|
-
const originY = obj.originY ?? "top";
|
|
13527
|
-
const localLeft = originX === "center" ? -w / 2 : originX === "right" ? -w : 0;
|
|
13528
|
-
const localTop = originY === "center" ? -h / 2 : originY === "bottom" ? -h : 0;
|
|
13529
13534
|
const matrix = fabric.util.multiplyTransformMatrices(
|
|
13530
13535
|
selection.calcTransformMatrix(),
|
|
13531
13536
|
obj.calcOwnMatrix()
|
|
13532
13537
|
);
|
|
13533
|
-
const
|
|
13534
|
-
|
|
13535
|
-
|
|
13536
|
-
|
|
13537
|
-
|
|
13538
|
-
|
|
13539
|
-
const
|
|
13540
|
-
const
|
|
13541
|
-
const left = Math.min(...xs);
|
|
13542
|
-
const top = Math.min(...ys);
|
|
13538
|
+
const decomposed = fabric.util.qrDecompose(matrix);
|
|
13539
|
+
const scaledW = Math.max(1, w * Math.abs(decomposed.scaleX || 1));
|
|
13540
|
+
const scaledH = Math.max(1, h * Math.abs(decomposed.scaleY || 1));
|
|
13541
|
+
const angleRad = (decomposed.angle ?? 0) * Math.PI / 180;
|
|
13542
|
+
const cos = Math.cos(angleRad);
|
|
13543
|
+
const sin = Math.sin(angleRad);
|
|
13544
|
+
const left = decomposed.translateX - scaledW / 2 * cos + scaledH / 2 * sin;
|
|
13545
|
+
const top = decomposed.translateY - scaledW / 2 * sin - scaledH / 2 * cos;
|
|
13543
13546
|
return {
|
|
13544
13547
|
left,
|
|
13545
13548
|
top,
|
|
13546
|
-
width:
|
|
13547
|
-
height:
|
|
13549
|
+
width: scaledW,
|
|
13550
|
+
height: scaledH
|
|
13548
13551
|
};
|
|
13549
13552
|
};
|
|
13550
13553
|
fabricCanvas.on("object:added", (e) => {
|
|
@@ -13740,7 +13743,7 @@ const PageCanvas = forwardRef(
|
|
|
13740
13743
|
const a = ((c.angle ?? 0) % 180 + 180) % 180;
|
|
13741
13744
|
return !(a < 0.5 || a > 179.5);
|
|
13742
13745
|
});
|
|
13743
|
-
if (isXSide && ((_b2 = groupShiftReflowSnapshotRef.current) == null ? void 0 : _b2.selection) !== obj) {
|
|
13746
|
+
if ((isXSide || hasRotatedChild) && ((_b2 = groupShiftReflowSnapshotRef.current) == null ? void 0 : _b2.selection) !== obj) {
|
|
13744
13747
|
groupShiftReflowSnapshotRef.current = null;
|
|
13745
13748
|
const logicalGroupId = obj.__pixldocsGroupSelection;
|
|
13746
13749
|
if (logicalGroupId) {
|
|
@@ -13752,7 +13755,9 @@ const PageCanvas = forwardRef(
|
|
|
13752
13755
|
const entries = obj.getObjects().map((c) => ({
|
|
13753
13756
|
obj: c,
|
|
13754
13757
|
id: getObjectId(c) ?? "",
|
|
13758
|
+
left0: c.left ?? 0,
|
|
13755
13759
|
top0: c.top ?? 0,
|
|
13760
|
+
width0: (c.width ?? 0) * Math.abs(c.scaleX ?? 1),
|
|
13756
13761
|
height0: (c.height ?? 0) * Math.abs(c.scaleY ?? 1)
|
|
13757
13762
|
})).filter((e2) => e2.id).sort((a, b) => a.top0 - b.top0);
|
|
13758
13763
|
if (entries.length > 1) {
|
|
@@ -13785,22 +13790,87 @@ const PageCanvas = forwardRef(
|
|
|
13785
13790
|
}
|
|
13786
13791
|
}
|
|
13787
13792
|
const childCounterScale = hasRotatedChild ? 1 : 1 / sAxis;
|
|
13793
|
+
const restoreNonTextChildren = (pins) => {
|
|
13794
|
+
var _a3, _b3;
|
|
13795
|
+
if (!hasRotatedChild || ((_a3 = groupShiftReflowSnapshotRef.current) == null ? void 0 : _a3.selection) !== obj) return;
|
|
13796
|
+
for (const entry of groupShiftReflowSnapshotRef.current.children) {
|
|
13797
|
+
const child = entry.obj;
|
|
13798
|
+
if (child instanceof fabric.Textbox) continue;
|
|
13799
|
+
if (child instanceof fabric.FabricImage || child instanceof fabric.Group && (child.__cropGroup || ((_b3 = child._ct) == null ? void 0 : _b3.isCropGroup))) {
|
|
13800
|
+
const pin = pins == null ? void 0 : pins.get(child);
|
|
13801
|
+
const targetLeft = (pin == null ? void 0 : pin.left) ?? (isXSide ? entry.left0 * sAxis : entry.left0);
|
|
13802
|
+
const targetTop = (pin == null ? void 0 : pin.top) ?? (isXSide ? entry.top0 : entry.top0 * sAxis);
|
|
13803
|
+
if (Math.abs((child.left ?? 0) - targetLeft) > 0.01) child._set("left", targetLeft);
|
|
13804
|
+
if (Math.abs((child.top ?? 0) - targetTop) > 0.01) child._set("top", targetTop);
|
|
13805
|
+
if (isXSide) child._set("scaleX", childCounterScale);
|
|
13806
|
+
else child._set("scaleY", childCounterScale);
|
|
13807
|
+
child.setCoords();
|
|
13808
|
+
child.dirty = true;
|
|
13809
|
+
}
|
|
13810
|
+
}
|
|
13811
|
+
};
|
|
13812
|
+
const projectRotatedTextPosition = (child) => {
|
|
13813
|
+
var _a3;
|
|
13814
|
+
if (!hasRotatedChild || ((_a3 = groupShiftReflowSnapshotRef.current) == null ? void 0 : _a3.selection) !== obj) return;
|
|
13815
|
+
const entry = groupShiftReflowSnapshotRef.current.children.find((candidate) => candidate.obj === child);
|
|
13816
|
+
if (!entry) return;
|
|
13817
|
+
if (isXSide) child._set("left", entry.left0 * sAxis);
|
|
13818
|
+
else child._set("top", entry.top0 * sAxis);
|
|
13819
|
+
};
|
|
13788
13820
|
for (const child of obj.getObjects()) {
|
|
13789
13821
|
if (child instanceof fabric.Group && (child.__cropGroup || ((_d = child._ct) == null ? void 0 : _d.isCropGroup))) {
|
|
13822
|
+
const ct = child.__cropData;
|
|
13823
|
+
if (ct) {
|
|
13824
|
+
if (child.__asLiveOrigW == null) {
|
|
13825
|
+
child.__asLiveOrigW = ct.frameW ?? child.width ?? 1;
|
|
13826
|
+
}
|
|
13827
|
+
if (child.__asLiveOrigH == null) {
|
|
13828
|
+
child.__asLiveOrigH = ct.frameH ?? child.height ?? 1;
|
|
13829
|
+
}
|
|
13830
|
+
if (isXSide) {
|
|
13831
|
+
const newW = Math.max(1, Number(child.__asLiveOrigW) * sAxis);
|
|
13832
|
+
ct.frameW = newW;
|
|
13833
|
+
child._set("width", newW);
|
|
13834
|
+
} else {
|
|
13835
|
+
const newH = Math.max(1, Number(child.__asLiveOrigH) * sAxis);
|
|
13836
|
+
ct.frameH = newH;
|
|
13837
|
+
child._set("height", newH);
|
|
13838
|
+
}
|
|
13839
|
+
try {
|
|
13840
|
+
updateCoverLayout(child);
|
|
13841
|
+
} catch {
|
|
13842
|
+
}
|
|
13843
|
+
}
|
|
13790
13844
|
if (isXSide) child._set("scaleX", childCounterScale);
|
|
13791
13845
|
else child._set("scaleY", childCounterScale);
|
|
13792
13846
|
child.setCoords();
|
|
13793
13847
|
child.dirty = true;
|
|
13848
|
+
didReflowTextChild = true;
|
|
13794
13849
|
continue;
|
|
13795
13850
|
}
|
|
13796
13851
|
if (child instanceof fabric.FabricImage && !child.__cropGroup && !child.smartElementType) {
|
|
13852
|
+
if (isXSide) {
|
|
13853
|
+
if (child.__asLiveOrigW == null) {
|
|
13854
|
+
child.__asLiveOrigW = (child.width ?? 0) * Math.abs(child.scaleX ?? 1);
|
|
13855
|
+
}
|
|
13856
|
+
const newW = Math.max(1, Number(child.__asLiveOrigW) * sAxis);
|
|
13857
|
+
child._set("width", newW);
|
|
13858
|
+
} else {
|
|
13859
|
+
if (child.__asLiveOrigH == null) {
|
|
13860
|
+
child.__asLiveOrigH = (child.height ?? 0) * Math.abs(child.scaleY ?? 1);
|
|
13861
|
+
}
|
|
13862
|
+
const newH = Math.max(1, Number(child.__asLiveOrigH) * sAxis);
|
|
13863
|
+
child._set("height", newH);
|
|
13864
|
+
}
|
|
13797
13865
|
if (isXSide) child._set("scaleX", childCounterScale);
|
|
13798
13866
|
else child._set("scaleY", childCounterScale);
|
|
13799
13867
|
child.setCoords();
|
|
13800
13868
|
child.dirty = true;
|
|
13869
|
+
didReflowTextChild = true;
|
|
13801
13870
|
continue;
|
|
13802
13871
|
}
|
|
13803
13872
|
if (!(child instanceof fabric.Textbox)) continue;
|
|
13873
|
+
projectRotatedTextPosition(child);
|
|
13804
13874
|
if (isXSide) {
|
|
13805
13875
|
if (child.__asLiveOrigW == null) {
|
|
13806
13876
|
child.__asLiveOrigW = (child.width ?? 0) * (child.scaleX ?? 1);
|
|
@@ -13868,10 +13938,12 @@ const PageCanvas = forwardRef(
|
|
|
13868
13938
|
if (cornersBefore) {
|
|
13869
13939
|
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 };
|
|
13870
13940
|
}
|
|
13941
|
+
const nonTextPinsBeforeLayout = hasRotatedChild ? new Map(obj.getObjects().map((child) => [child, { left: child.left ?? 0, top: child.top ?? 0 }])) : void 0;
|
|
13871
13942
|
try {
|
|
13872
13943
|
obj.triggerLayout();
|
|
13873
13944
|
} catch {
|
|
13874
13945
|
}
|
|
13946
|
+
restoreNonTextChildren(nonTextPinsBeforeLayout);
|
|
13875
13947
|
obj._set("width", asW0);
|
|
13876
13948
|
obj._set("scaleX", asSx0);
|
|
13877
13949
|
obj._set("scaleY", asSy0);
|
|
@@ -13897,6 +13969,7 @@ const PageCanvas = forwardRef(
|
|
|
13897
13969
|
obj._set("left", asLeft0);
|
|
13898
13970
|
obj._set("top", asTop0);
|
|
13899
13971
|
}
|
|
13972
|
+
restoreNonTextChildren();
|
|
13900
13973
|
obj._set("width", asW0);
|
|
13901
13974
|
obj._set("scaleX", asSx0);
|
|
13902
13975
|
obj._set("scaleY", asSy0);
|
|
@@ -14352,8 +14425,9 @@ const PageCanvas = forwardRef(
|
|
|
14352
14425
|
const stateCrop = useEditorStore.getState();
|
|
14353
14426
|
const pageCrop = stateCrop.canvas.pages.find((p) => p.id === pageId);
|
|
14354
14427
|
const pageChildrenCrop = (pageCrop == null ? void 0 : pageCrop.children) ?? [];
|
|
14355
|
-
const
|
|
14356
|
-
const
|
|
14428
|
+
const angleRad = (active.angle ?? 0) * Math.PI / 180;
|
|
14429
|
+
const absLeft = (active.left ?? 0) - ct.frameW / 2 * Math.cos(angleRad) + ct.frameH / 2 * Math.sin(angleRad);
|
|
14430
|
+
const absTop = (active.top ?? 0) - ct.frameW / 2 * Math.sin(angleRad) - ct.frameH / 2 * Math.cos(angleRad);
|
|
14357
14431
|
const storePosCrop = absoluteToStorePosition(absLeft, absTop, objId, pageChildrenCrop);
|
|
14358
14432
|
updateElement2(objId, {
|
|
14359
14433
|
width: ct.frameW,
|
|
@@ -14537,6 +14611,7 @@ const PageCanvas = forwardRef(
|
|
|
14537
14611
|
return;
|
|
14538
14612
|
}
|
|
14539
14613
|
}
|
|
14614
|
+
const isActiveSelectionSideResize = isActiveSelection && (activeSelectionResizeHandle === "ml" || activeSelectionResizeHandle === "mr" || activeSelectionResizeHandle === "mt" || activeSelectionResizeHandle === "mb");
|
|
14540
14615
|
if (selectedElementIds.length > 0 && !anyCropGroup) {
|
|
14541
14616
|
const firstObj = activeObjects[0];
|
|
14542
14617
|
const firstId = getObjectId(firstObj);
|
|
@@ -14598,7 +14673,8 @@ const PageCanvas = forwardRef(
|
|
|
14598
14673
|
}
|
|
14599
14674
|
const deltaX = movedGroupLeft - groupAbs.left;
|
|
14600
14675
|
const deltaY = movedGroupTop - groupAbs.top;
|
|
14601
|
-
const
|
|
14676
|
+
const hadResizeHandle = isActiveSelection && !!activeSelectionResizeHandle;
|
|
14677
|
+
const hadScale = isActiveSelection && activeObj && (hadResizeHandle || Math.abs((activeObj.scaleX ?? 1) - 1) > 0.01 || Math.abs((activeObj.scaleY ?? 1) - 1) > 0.01);
|
|
14602
14678
|
const startSelAngle = (((transformStart == null ? void 0 : transformStart.selectionAngle) ?? 0) % 360 + 360) % 360;
|
|
14603
14679
|
const currentSelAngle = isActiveSelection && activeObj ? ((activeObj.angle ?? 0) % 360 + 360) % 360 : 0;
|
|
14604
14680
|
const angleDelta = Math.min(
|
|
@@ -14606,7 +14682,7 @@ const PageCanvas = forwardRef(
|
|
|
14606
14682
|
360 - Math.abs(currentSelAngle - startSelAngle)
|
|
14607
14683
|
);
|
|
14608
14684
|
const hadRotation = isActiveSelection && activeObj && angleDelta > 0.01;
|
|
14609
|
-
if (!hadScale && !hadRotation && (Math.abs(deltaX) > 0.1 || Math.abs(deltaY) > 0.1)) {
|
|
14685
|
+
if (!isActiveSelectionSideResize && !hadScale && !hadRotation && (Math.abs(deltaX) > 0.1 || Math.abs(deltaY) > 0.1)) {
|
|
14610
14686
|
const { updateNode: updateNodeStore, commitHistory: commitHistoryStore, getCurrentElements } = useEditorStore.getState();
|
|
14611
14687
|
const newLeft = (groupToMove.left ?? 0) + deltaX;
|
|
14612
14688
|
const newTop = (groupToMove.top ?? 0) + deltaY;
|
|
@@ -14712,14 +14788,16 @@ const PageCanvas = forwardRef(
|
|
|
14712
14788
|
} else {
|
|
14713
14789
|
const w = ((ct == null ? void 0 : ct.frameW) ?? obj.width ?? 0) * Math.abs(obj.scaleX ?? 1);
|
|
14714
14790
|
const h = ((ct == null ? void 0 : ct.frameH) ?? obj.height ?? 0) * Math.abs(obj.scaleY ?? 1);
|
|
14715
|
-
|
|
14716
|
-
|
|
14791
|
+
const angleRad = (decomposed.angle ?? obj.angle ?? 0) * Math.PI / 180;
|
|
14792
|
+
absoluteLeft = (decomposed.translateX ?? absoluteLeft ?? 0) - w / 2 * Math.cos(angleRad) + h / 2 * Math.sin(angleRad);
|
|
14793
|
+
absoluteTop = (decomposed.translateY ?? absoluteTop ?? 0) - w / 2 * Math.sin(angleRad) - h / 2 * Math.cos(angleRad);
|
|
14717
14794
|
}
|
|
14718
14795
|
} else if (obj instanceof fabric.FabricImage && (obj.originX === "center" || obj.originY === "center")) {
|
|
14719
14796
|
const w = (obj.width ?? 0) * (obj.scaleX ?? 1);
|
|
14720
14797
|
const h = (obj.height ?? 0) * (obj.scaleY ?? 1);
|
|
14721
|
-
|
|
14722
|
-
|
|
14798
|
+
const angleRad = (decomposed.angle ?? obj.angle ?? 0) * Math.PI / 180;
|
|
14799
|
+
absoluteLeft = (decomposed.translateX ?? absoluteLeft ?? 0) - w / 2 * Math.cos(angleRad) + h / 2 * Math.sin(angleRad);
|
|
14800
|
+
absoluteTop = (decomposed.translateY ?? absoluteTop ?? 0) - w / 2 * Math.sin(angleRad) - h / 2 * Math.cos(angleRad);
|
|
14723
14801
|
}
|
|
14724
14802
|
const preserveCornerGeometry = (sourceElement == null ? void 0 : sourceElement.type) === "shape" && (sourceElement.shapeType === "circle" || sourceElement.shapeType === "rounded-rect" || sourceElement.shapeType === "triangle");
|
|
14725
14803
|
let finalWidth = intrinsicWidth;
|
|
@@ -14746,12 +14824,14 @@ const PageCanvas = forwardRef(
|
|
|
14746
14824
|
absoluteLeft = frameBounds.left;
|
|
14747
14825
|
absoluteTop = frameBounds.top;
|
|
14748
14826
|
} else {
|
|
14749
|
-
|
|
14750
|
-
|
|
14827
|
+
const angleRad = (decomposed.angle ?? obj.angle ?? 0) * Math.PI / 180;
|
|
14828
|
+
absoluteLeft = (decomposed.translateX ?? absoluteLeft) - finalWidth / 2 * Math.cos(angleRad) + finalHeight / 2 * Math.sin(angleRad);
|
|
14829
|
+
absoluteTop = (decomposed.translateY ?? absoluteTop) - finalWidth / 2 * Math.sin(angleRad) - finalHeight / 2 * Math.cos(angleRad);
|
|
14751
14830
|
}
|
|
14831
|
+
const finalCenter = rotatedTopLeftToCenter(absoluteLeft, absoluteTop, finalWidth, finalHeight, decomposed.angle ?? (obj.angle ?? 0));
|
|
14752
14832
|
finalAbsoluteMatrix = fabric.util.composeMatrix({
|
|
14753
|
-
translateX:
|
|
14754
|
-
translateY:
|
|
14833
|
+
translateX: finalCenter.x,
|
|
14834
|
+
translateY: finalCenter.y,
|
|
14755
14835
|
angle: decomposed.angle ?? (obj.angle ?? 0),
|
|
14756
14836
|
scaleX: 1,
|
|
14757
14837
|
scaleY: 1,
|
|
@@ -15137,9 +15217,10 @@ const PageCanvas = forwardRef(
|
|
|
15137
15217
|
if (!ct) continue;
|
|
15138
15218
|
ct.frameW = bake.width;
|
|
15139
15219
|
ct.frameH = bake.height;
|
|
15220
|
+
const bakeCenter = rotatedTopLeftToCenter(bake.left, bake.top, bake.width, bake.height, bake.angle);
|
|
15140
15221
|
bake.obj.set({
|
|
15141
|
-
left:
|
|
15142
|
-
top:
|
|
15222
|
+
left: bakeCenter.x,
|
|
15223
|
+
top: bakeCenter.y,
|
|
15143
15224
|
width: bake.width,
|
|
15144
15225
|
height: bake.height,
|
|
15145
15226
|
scaleX: 1,
|
|
@@ -15736,8 +15817,9 @@ const PageCanvas = forwardRef(
|
|
|
15736
15817
|
const node = findNodeById(pageChildren, element.id);
|
|
15737
15818
|
return node ? getAbsoluteBounds(node, pageChildren) : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15738
15819
|
})() : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15739
|
-
const
|
|
15740
|
-
const
|
|
15820
|
+
const cropCenter = rotatedTopLeftToCenter(cropPos.left, cropPos.top, ct.frameW ?? 0, ct.frameH ?? 0, element.angle ?? 0);
|
|
15821
|
+
const cropCenterX = cropCenter.x;
|
|
15822
|
+
const cropCenterY = cropCenter.y;
|
|
15741
15823
|
if (element.left !== void 0) existingObj.set({ left: cropCenterX });
|
|
15742
15824
|
if (element.top !== void 0) existingObj.set({ top: cropCenterY });
|
|
15743
15825
|
if (element.angle !== void 0) existingObj.set({ angle: element.angle });
|
|
@@ -16673,8 +16755,9 @@ const PageCanvas = forwardRef(
|
|
|
16673
16755
|
ct.shape = clipShape === "circle" ? "circle" : clipShape === "rounded" ? "roundRect" : "rect";
|
|
16674
16756
|
ct.rx = rxRatio;
|
|
16675
16757
|
obj.__maintainResolution = element.maintainResolution !== false;
|
|
16676
|
-
const
|
|
16677
|
-
const
|
|
16758
|
+
const center = rotatedTopLeftToCenter(fabricPos.left, fabricPos.top, elementWidth, elementHeight, element.angle ?? 0);
|
|
16759
|
+
const centerX = center.x;
|
|
16760
|
+
const centerY = center.y;
|
|
16678
16761
|
const cropSetProps = {
|
|
16679
16762
|
width: elementWidth,
|
|
16680
16763
|
height: elementHeight,
|
|
@@ -16914,7 +16997,8 @@ const PageCanvas = forwardRef(
|
|
|
16914
16997
|
if (!skipPositionUpdate && (obj instanceof fabric.FabricImage && obj.originX === "center" || obj instanceof fabric.Group && obj.__cropGroup)) {
|
|
16915
16998
|
const vW = rW * effectiveScaleX;
|
|
16916
16999
|
const vH = rH * effectiveScaleY;
|
|
16917
|
-
|
|
17000
|
+
const center = rotatedTopLeftToCenter(fabricPos.left, fabricPos.top, vW, vH, element.angle ?? 0);
|
|
17001
|
+
posIfNotSkipped = { left: center.x, top: center.y };
|
|
16918
17002
|
}
|
|
16919
17003
|
if (element.transformMatrix && element.transformMatrix.length === 6) {
|
|
16920
17004
|
if (isTextbox) {
|
|
@@ -24212,9 +24296,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24212
24296
|
}
|
|
24213
24297
|
return svgString;
|
|
24214
24298
|
}
|
|
24215
|
-
const resolvedPackageVersion = "0.5.
|
|
24299
|
+
const resolvedPackageVersion = "0.5.331";
|
|
24216
24300
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24217
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24301
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.331";
|
|
24218
24302
|
const roundParityValue = (value) => {
|
|
24219
24303
|
if (typeof value !== "number") return value;
|
|
24220
24304
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25028,7 +25112,7 @@ class PixldocsRenderer {
|
|
|
25028
25112
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25029
25113
|
}
|
|
25030
25114
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25031
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
25115
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DvpRTaGb.js");
|
|
25032
25116
|
const prepared = preparePagesForExport(
|
|
25033
25117
|
cloned.pages,
|
|
25034
25118
|
canvasWidth,
|
|
@@ -27348,7 +27432,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27348
27432
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27349
27433
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27350
27434
|
try {
|
|
27351
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
27435
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DvpRTaGb.js");
|
|
27352
27436
|
try {
|
|
27353
27437
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27354
27438
|
} catch {
|
|
@@ -27748,4 +27832,4 @@ export {
|
|
|
27748
27832
|
buildTeaserBlurFlatKeys as y,
|
|
27749
27833
|
collectFontDescriptorsFromConfig as z
|
|
27750
27834
|
};
|
|
27751
|
-
//# sourceMappingURL=index-
|
|
27835
|
+
//# sourceMappingURL=index-C9n6xrCt.js.map
|