fix(capture): preserve PhotoStage preview aspect on first paint

Contain-fit waits for a real parent width, uses ResizeObserver, and shrinks
width when maxH would otherwise stretch the CSS box. Pure fitDisplay is
covered by node tests.
This commit is contained in:
2026-09-14 16:37:00 +00:00
parent 0e94b1fd2a
commit b781ffeb66
6 changed files with 568 additions and 21 deletions
+3 -1
View File
@@ -6,7 +6,8 @@
"scripts": {
"dev": "vite",
"build": "tsc --noEmit && vite build",
"preview": "vite preview"
"preview": "vite preview",
"test": "node --import tsx --test src/**/*.test.ts"
},
"dependencies": {
"idb-keyval": "^6.3.0",
@@ -15,6 +16,7 @@
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"svelte-preprocess": "^5.1.4",
"tsx": "^4.23.13",
"typescript": "^5.7.3",
"vite": "^5.4.19"
}