This commit is contained in:
dwelle
2026-03-14 12:38:38 +01:00
parent c9ba7f839c
commit 1625edeb07
19 changed files with 1118 additions and 633 deletions
+18 -10
View File
@@ -330,22 +330,30 @@ describe("Cropping and other features", async () => {
const widthToHeightRatio = image.width / image.height;
const canvas = await exportToCanvas({
elements: [image],
// @ts-ignore
appState: h.state,
files: h.app.files,
exportPadding: 0,
data: {
elements: [image],
// @ts-ignore
appState: h.state,
files: h.app.files,
},
config: {
padding: 0,
},
});
const exportedCanvasRatio = canvas.width / canvas.height;
expect(widthToHeightRatio).toBeCloseTo(exportedCanvasRatio);
const svg = await exportToSvg({
elements: [image],
// @ts-ignore
appState: h.state,
files: h.app.files,
exportPadding: 0,
data: {
elements: [image],
// @ts-ignore
appState: h.state,
files: h.app.files,
},
config: {
padding: 0,
},
});
const svgWidth = svg.getAttribute("width");
const svgHeight = svg.getAttribute("height");