fundus 0.0.2 → 0.0.4
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/README.md +73 -0
- package/build/client/_app/immutable/assets/0.DLhIsYA_.css.br +0 -0
- package/build/client/_app/immutable/assets/0.DLhIsYA_.css.gz +0 -0
- package/build/client/_app/immutable/assets/2.ohi-TClG.css +1 -0
- package/build/client/_app/immutable/assets/2.ohi-TClG.css.br +0 -0
- package/build/client/_app/immutable/assets/2.ohi-TClG.css.gz +0 -0
- package/build/client/_app/immutable/assets/3.JwgtcTEd.css +1 -0
- package/build/client/_app/immutable/assets/3.JwgtcTEd.css.br +0 -0
- package/build/client/_app/immutable/assets/3.JwgtcTEd.css.gz +0 -0
- package/build/client/_app/immutable/assets/4.p004hmEN.css +1 -0
- package/build/client/_app/immutable/assets/4.p004hmEN.css.br +0 -0
- package/build/client/_app/immutable/assets/4.p004hmEN.css.gz +0 -0
- package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css +1 -0
- package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css.br +0 -0
- package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css.gz +0 -0
- package/build/client/_app/immutable/assets/LibraryContextMenu.CMefGNE2.css +1 -0
- package/build/client/_app/immutable/assets/LibraryContextMenu.CMefGNE2.css.br +0 -0
- package/build/client/_app/immutable/assets/LibraryContextMenu.CMefGNE2.css.gz +0 -0
- package/build/client/_app/immutable/chunks/Bjy-W4x2.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bjy-W4x2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CNRz3sSw.js.br +0 -0
- package/build/client/_app/immutable/chunks/CNRz3sSw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CO4RBJfa.js.br +0 -0
- package/build/client/_app/immutable/chunks/CO4RBJfa.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DOpBpjxS.js +108 -0
- package/build/client/_app/immutable/chunks/DOpBpjxS.js.br +0 -0
- package/build/client/_app/immutable/chunks/DOpBpjxS.js.gz +0 -0
- package/{dist/editor/_app/immutable/chunks/BfPE5wdt.js → build/client/_app/immutable/chunks/DVEQFclp.js} +1 -1
- package/build/client/_app/immutable/chunks/DVEQFclp.js.br +1 -0
- package/build/client/_app/immutable/chunks/DVEQFclp.js.gz +0 -0
- package/{dist/editor/_app/immutable/chunks/DjvOiDmq.js → build/client/_app/immutable/chunks/DiFoWL2c.js} +1 -1
- package/build/client/_app/immutable/chunks/DiFoWL2c.js.br +0 -0
- package/build/client/_app/immutable/chunks/DiFoWL2c.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DkADHpZF.js +1 -0
- package/build/client/_app/immutable/chunks/DkADHpZF.js.br +0 -0
- package/build/client/_app/immutable/chunks/DkADHpZF.js.gz +0 -0
- package/build/client/_app/immutable/chunks/xihTtKlq.js.br +1 -0
- package/build/client/_app/immutable/chunks/xihTtKlq.js.gz +0 -0
- package/{dist/editor/_app/immutable/entry/app.BkqbfI8n.js → build/client/_app/immutable/entry/app.CKgtYXQb.js} +2 -2
- package/build/client/_app/immutable/entry/app.CKgtYXQb.js.br +0 -0
- package/build/client/_app/immutable/entry/app.CKgtYXQb.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.CYZu5qE1.js +1 -0
- package/build/client/_app/immutable/entry/start.CYZu5qE1.js.br +0 -0
- package/build/client/_app/immutable/entry/start.CYZu5qE1.js.gz +0 -0
- package/{dist/editor/_app/immutable/nodes/0.xdMI5GEU.js → build/client/_app/immutable/nodes/0.I_1SApYQ.js} +1 -1
- package/build/client/_app/immutable/nodes/0.I_1SApYQ.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.I_1SApYQ.js.gz +0 -0
- package/{dist/editor/_app/immutable/nodes/1.D9p2tfoJ.js → build/client/_app/immutable/nodes/1.v6eUTnWq.js} +1 -1
- package/build/client/_app/immutable/nodes/1.v6eUTnWq.js.br +2 -0
- package/build/client/_app/immutable/nodes/1.v6eUTnWq.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.DoA7Dfl-.js +3 -0
- package/build/client/_app/immutable/nodes/2.DoA7Dfl-.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.DoA7Dfl-.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.C-DO70Bs.js +1 -0
- package/build/client/_app/immutable/nodes/3.C-DO70Bs.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.C-DO70Bs.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.CALOuSyz.js +2 -0
- package/build/client/_app/immutable/nodes/4.CALOuSyz.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.CALOuSyz.js.gz +0 -0
- package/build/client/_app/version.json +1 -0
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/env.js +100 -0
- package/build/env.js.map +1 -0
- package/build/handler.js +22 -0
- package/build/handler.js.map +1 -0
- package/build/index.js +145 -0
- package/build/index.js.map +1 -0
- package/build/server/chunks/chunks/context.js-BUZqFfWG.js +429 -0
- package/build/server/chunks/chunks/context.js-BUZqFfWG.js.map +1 -0
- package/build/server/chunks/chunks/core.js-xfrkaQpS.js +458 -0
- package/build/server/chunks/chunks/core.js-xfrkaQpS.js.map +1 -0
- package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +2 -0
- package/build/server/chunks/chunks/env.js-l0sNRNKZ.js.map +1 -0
- package/build/server/chunks/chunks/exports.js-C0rwMMtk.js +152 -0
- package/build/server/chunks/chunks/exports.js-C0rwMMtk.js.map +1 -0
- package/build/server/chunks/chunks/folder-path.js-ytx9ucgg.js +64 -0
- package/build/server/chunks/chunks/folder-path.js-ytx9ucgg.js.map +1 -0
- package/build/server/chunks/chunks/http.js-DvopzwKh.js +100 -0
- package/build/server/chunks/chunks/http.js-DvopzwKh.js.map +1 -0
- package/build/server/chunks/chunks/internal.js-DGo2jPcg.js +5753 -0
- package/build/server/chunks/chunks/internal.js-DGo2jPcg.js.map +1 -0
- package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js +22 -0
- package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js.map +1 -0
- package/{dist/operations-DYM-5KVl.js → build/server/chunks/chunks/library-store.js-ZLudCJlT.js} +463 -492
- package/build/server/chunks/chunks/library-store.js-ZLudCJlT.js.map +1 -0
- package/build/server/chunks/chunks/manifest-appearance.js-DTk355LQ.js +146 -0
- package/build/server/chunks/chunks/manifest-appearance.js-DTk355LQ.js.map +1 -0
- package/build/server/chunks/chunks/routing.js-y-tryuip.js +213 -0
- package/build/server/chunks/chunks/routing.js-y-tryuip.js.map +1 -0
- package/build/server/chunks/chunks/shared.js-B1gC9MiJ.js +255 -0
- package/build/server/chunks/chunks/shared.js-B1gC9MiJ.js.map +1 -0
- package/build/server/chunks/chunks/utils.js-DnEJ3UjO.js +1048 -0
- package/build/server/chunks/chunks/utils.js-DnEJ3UjO.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-Cq5gXVQT.js +27 -0
- package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-Cq5gXVQT.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-RXbedi8q.js +24 -0
- package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-RXbedi8q.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-D7Qae9vU.js +45 -0
- package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-D7Qae9vU.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-DtO20kgB.js +31 -0
- package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-DtO20kgB.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-BUebPbd5.js +31 -0
- package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-BUebPbd5.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-BjT2qPMT.js +38 -0
- package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-BjT2qPMT.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-DYRLsoT7.js +31 -0
- package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-DYRLsoT7.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BbN2fGNN.js +24 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BbN2fGNN.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-b_MKZ41b.js +31 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-b_MKZ41b.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-evEfMpvn.js +24 -0
- package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-evEfMpvn.js.map +1 -0
- package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-C04XE_1w.js +27 -0
- package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-C04XE_1w.js.map +1 -0
- package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-DB8TdoEv.js +24 -0
- package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-DB8TdoEv.js.map +1 -0
- package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-BrpaijZO.js +24 -0
- package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-BrpaijZO.js.map +1 -0
- package/build/server/chunks/entries/hooks.server.js-BJJwZW_I.js +23 -0
- package/build/server/chunks/entries/hooks.server.js-BJJwZW_I.js.map +1 -0
- package/build/server/chunks/handler-DnbS2t1B.js +1475 -0
- package/build/server/chunks/handler-DnbS2t1B.js.map +1 -0
- package/build/server/chunks/index.js-g77q3Boj.js +3789 -0
- package/build/server/chunks/index.js-g77q3Boj.js.map +1 -0
- package/build/server/chunks/manifest.js-qmEXbstS.js +149 -0
- package/build/server/chunks/manifest.js-qmEXbstS.js.map +1 -0
- package/build/server/chunks/nodes/0.js-Bk6IZ-vD.js +11 -0
- package/build/server/chunks/nodes/0.js-Bk6IZ-vD.js.map +1 -0
- package/build/server/chunks/nodes/1.js-H-qwo4GJ.js +7 -0
- package/build/server/chunks/nodes/1.js-H-qwo4GJ.js.map +1 -0
- package/build/server/chunks/nodes/2.js-DRpXVLwp.js +7 -0
- package/build/server/chunks/nodes/2.js-DRpXVLwp.js.map +1 -0
- package/build/server/chunks/nodes/3.js-CDEzNFeU.js +7 -0
- package/build/server/chunks/nodes/3.js-CDEzNFeU.js.map +1 -0
- package/build/server/chunks/nodes/4.js-BKL7LSSm.js +7 -0
- package/build/server/chunks/nodes/4.js-BKL7LSSm.js.map +1 -0
- package/build/shims.js +33 -0
- package/build/shims.js.map +1 -0
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +116 -1336
- package/dist/config.d.ts +3 -2
- package/dist/config.js +2 -2
- package/dist/core/api-types.d.ts +141 -0
- package/dist/core/api-types.js +1 -0
- package/dist/core/asset-id.d.ts +28 -0
- package/dist/core/asset-id.js +59 -0
- package/dist/core/asset-reference.d.ts +23 -0
- package/dist/core/asset-reference.js +15 -0
- package/dist/core/canonicalize.d.ts +9 -0
- package/dist/core/canonicalize.js +36 -0
- package/dist/core/chroma-key.d.ts +30 -0
- package/dist/core/chroma-key.js +55 -0
- package/dist/core/config.d.ts +35 -0
- package/dist/core/config.js +4 -0
- package/dist/core/folder-path.d.ts +19 -0
- package/dist/core/folder-path.js +86 -0
- package/dist/core/index.d.ts +33 -499
- package/dist/core/index.js +17 -962
- package/dist/core/ingest.d.ts +24 -0
- package/dist/core/ingest.js +42 -0
- package/dist/core/library.d.ts +54 -0
- package/dist/core/library.js +138 -0
- package/dist/core/manifest-appearance.d.ts +35 -0
- package/dist/core/manifest-appearance.js +123 -0
- package/dist/core/manifest-entry.d.ts +104 -0
- package/dist/core/manifest-entry.js +1 -0
- package/dist/core/manifest-membership.d.ts +56 -0
- package/dist/core/manifest-membership.js +54 -0
- package/dist/core/plugins/audio.d.ts +26 -0
- package/dist/core/plugins/audio.js +44 -0
- package/dist/core/plugins/chroma-key-video.d.ts +29 -0
- package/dist/core/plugins/chroma-key-video.js +69 -0
- package/dist/core/plugins/contract.d.ts +35 -0
- package/dist/core/plugins/contract.js +1 -0
- package/dist/core/plugins/image.d.ts +30 -0
- package/dist/core/plugins/image.js +45 -0
- package/dist/core/plugins/registry.d.ts +16 -0
- package/dist/core/plugins/registry.js +52 -0
- package/dist/core/plugins/slice.d.ts +22 -0
- package/dist/core/plugins/slice.js +60 -0
- package/dist/core/plugins/video.d.ts +45 -0
- package/dist/core/plugins/video.js +77 -0
- package/dist/core/reference-graph.d.ts +41 -0
- package/dist/core/reference-graph.js +138 -0
- package/dist/core/slice-data.d.ts +61 -0
- package/dist/core/slice-data.js +49 -0
- package/dist/runtime/chroma-key-gl.d.ts +40 -22
- package/dist/runtime/chroma-key-gl.js +189 -183
- package/dist/runtime/components/ChromaKeyVideo.svelte +3 -3
- package/dist/runtime/components/ChromaKeyVideo.svelte.d.ts +21 -0
- package/dist/runtime/components/Image.svelte +1 -1
- package/dist/runtime/components/Image.svelte.d.ts +9 -0
- package/dist/runtime/components/Slice.svelte +1 -1
- package/dist/runtime/components/Slice.svelte.d.ts +19 -0
- package/dist/runtime/components/SliceCanvas.svelte +3 -3
- package/dist/runtime/components/SliceCanvas.svelte.d.ts +10 -0
- package/dist/runtime/components/SliceDom.svelte +3 -3
- package/dist/runtime/components/SliceDom.svelte.d.ts +10 -0
- package/dist/runtime/components/Video.svelte +2 -2
- package/dist/runtime/components/Video.svelte.d.ts +18 -0
- package/dist/runtime/geometry.d.ts +55 -35
- package/dist/runtime/geometry.js +186 -191
- package/dist/runtime/index.d.ts +9 -9
- package/dist/runtime/index.js +9 -9
- package/dist/runtime/kind-handlers.d.ts +33 -30
- package/dist/runtime/kind-handlers.js +85 -67
- package/dist/runtime/manifest.d.ts +53 -47
- package/dist/runtime/manifest.js +133 -113
- package/dist/runtime/observe-border-box-size.d.ts +1 -4
- package/dist/runtime/observe-border-box-size.js +9 -10
- package/dist/runtime/preload-registry.d.ts +22 -8
- package/dist/runtime/preload-registry.js +65 -62
- package/dist/server/build.d.ts +8 -0
- package/dist/server/build.js +25 -0
- package/dist/server/check.d.ts +24 -0
- package/dist/server/check.js +199 -0
- package/dist/server/cli-commands.d.ts +25 -0
- package/dist/server/cli-commands.js +1178 -0
- package/dist/server/cli-init.d.ts +3 -0
- package/dist/server/cli-init.js +53 -0
- package/dist/server/cli-io.d.ts +46 -0
- package/dist/server/cli-io.js +105 -0
- package/dist/server/codegen.d.ts +58 -0
- package/dist/server/codegen.js +185 -0
- package/dist/server/config-loader.d.ts +35 -0
- package/dist/server/config-loader.js +79 -0
- package/dist/server/context.d.ts +8 -0
- package/dist/server/context.js +19 -0
- package/dist/server/folder-filesystem.d.ts +7 -0
- package/dist/server/folder-filesystem.js +39 -0
- package/dist/server/http.d.ts +12 -0
- package/dist/server/http.js +100 -0
- package/dist/server/index.d.ts +17 -0
- package/dist/server/index.js +9 -0
- package/dist/server/job-hash.d.ts +10 -0
- package/dist/server/job-hash.js +23 -0
- package/dist/server/library-store.d.ts +82 -0
- package/dist/server/library-store.js +763 -0
- package/dist/server/operations.d.ts +87 -0
- package/dist/server/operations.js +427 -0
- package/dist/server/plugins/audio.d.ts +8 -0
- package/dist/server/plugins/audio.js +41 -0
- package/dist/server/plugins/chroma-key-video.d.ts +9 -0
- package/dist/server/plugins/chroma-key-video.js +40 -0
- package/dist/server/plugins/config.d.ts +13 -0
- package/dist/server/plugins/config.js +32 -0
- package/dist/server/plugins/contract.d.ts +114 -0
- package/dist/server/plugins/contract.js +16 -0
- package/dist/server/plugins/image.d.ts +9 -0
- package/dist/server/plugins/image.js +43 -0
- package/dist/server/plugins/slice.d.ts +15 -0
- package/dist/server/plugins/slice.js +76 -0
- package/dist/server/plugins/video.d.ts +7 -0
- package/dist/server/plugins/video.js +54 -0
- package/dist/server/plugins.d.ts +23 -0
- package/dist/server/plugins.js +35 -0
- package/dist/server/processing/audio-processing.d.ts +17 -0
- package/dist/server/processing/audio-processing.js +46 -0
- package/dist/server/processing/ffmpeg.d.ts +9 -0
- package/dist/server/processing/ffmpeg.js +50 -0
- package/dist/server/processing/image-processing.d.ts +16 -0
- package/dist/server/processing/image-processing.js +26 -0
- package/dist/server/processing/media-probe.d.ts +15 -0
- package/dist/server/processing/media-probe.js +27 -0
- package/dist/server/processing/processor.d.ts +50 -0
- package/dist/server/processing/processor.js +158 -0
- package/dist/server/processing/video-processing.d.ts +35 -0
- package/dist/server/processing/video-processing.js +87 -0
- package/dist/server/server.d.ts +13 -0
- package/dist/server/server.js +57 -0
- package/dist/server/start.d.ts +13 -0
- package/dist/server/start.js +80 -0
- package/package.json +31 -16
- package/dist/build-CZYFLLvl.js +0 -191
- package/dist/core/image-Dqmz8FXS.js +0 -54
- package/dist/core/reference-graph-CjuHbLDw.d.ts +0 -280
- package/dist/core/testing.d.ts +0 -27
- package/dist/core/testing.js +0 -80
- package/dist/editor/200.html +0 -37
- package/dist/editor/_app/immutable/assets/2.DIbbW7U1.css +0 -1
- package/dist/editor/_app/immutable/assets/3.C-9vFQ9A.css +0 -1
- package/dist/editor/_app/immutable/assets/4.BS8ElpOV.css +0 -1
- package/dist/editor/_app/immutable/assets/ConfirmDialog.CHEISE-L.css +0 -1
- package/dist/editor/_app/immutable/assets/LibraryContextMenu.CDjCmdV-.css +0 -1
- package/dist/editor/_app/immutable/chunks/Cx6qtxJg.js +0 -1
- package/dist/editor/_app/immutable/chunks/DjdrdRzT.js +0 -1
- package/dist/editor/_app/immutable/chunks/n7mvYc42.js +0 -5
- package/dist/editor/_app/immutable/entry/start.C8HHOLly.js +0 -1
- package/dist/editor/_app/immutable/nodes/2.BrA0Hyzu.js +0 -3
- package/dist/editor/_app/immutable/nodes/3.WO7tZH_d.js +0 -104
- package/dist/editor/_app/immutable/nodes/4.DQtx17aW.js +0 -2
- package/dist/editor/_app/version.json +0 -1
- package/dist/index.d.ts +0 -370
- package/dist/index.js +0 -4
- package/dist/start-Bhnqt9Dc.js +0 -279
- package/dist/start-D2IXOrni.js +0 -2
- /package/{dist/editor → build/client}/_app/immutable/assets/0.DLhIsYA_.css +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/Bjy-W4x2.js +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/CNRz3sSw.js +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/CO4RBJfa.js +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/xihTtKlq.js +0 -0
|
@@ -1,31 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Pure slice geometry operating on a `SliceManifestEntry` (slicing + source
|
|
3
|
+
* dimensions). Given an entry and the box (container) size in
|
|
4
|
+
* CSS pixels, it returns the cells to paint — each with its SOURCE rect
|
|
5
|
+
* (pixels, for sampling the image) and DEST rect (CSS pixels within the box).
|
|
6
|
+
* One function covers all modes:
|
|
7
|
+
*
|
|
8
|
+
* - `nine` — corners are fixed at their logical size (inset ÷
|
|
9
|
+
* pixelRatio); edges stretch one axis, the center stretches both.
|
|
10
|
+
* - `three-horizontal` — left/right caps fill the box height (cross axis) keeping
|
|
11
|
+
* their aspect ratio (so they scale with the box); the center stretches across
|
|
12
|
+
* the remaining width.
|
|
13
|
+
* - `three-vertical` — top/bottom caps fill the box width keeping their aspect
|
|
14
|
+
* ratio; the middle stretches down the remaining height.
|
|
15
|
+
* - `one` — no slicing: the whole image is one cell stretched to
|
|
16
|
+
* fill the box on both axes (per-axis scale, like a plain `<img>`).
|
|
17
|
+
*
|
|
18
|
+
* **Overdraw** (`slicing.overdraw`): a baked-in drop shadow / glow band around
|
|
19
|
+
* the actual element. The image minus the overdraw is the element core; the core
|
|
20
|
+
* fills the layout box and the overdraw is painted outside it. Implemented by
|
|
21
|
+
* rendering into a virtual box expanded by the overdraw's destination size on
|
|
22
|
+
* each side and shifting every cell back by that amount — so cells can have
|
|
23
|
+
* negative `dx`/`dy` and extend past the box (like a CSS `box-shadow`).
|
|
24
|
+
*/
|
|
25
|
+
import type { SliceInsets, SliceManifestEntry } from '../core/index.js';
|
|
4
26
|
/** One cell to paint: a source rect (px) drawn into a dest rect (CSS px). */
|
|
5
|
-
interface RenderCell {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
27
|
+
export interface RenderCell {
|
|
28
|
+
key: string;
|
|
29
|
+
/** Source rect, in source pixels. */
|
|
30
|
+
sx: number;
|
|
31
|
+
sy: number;
|
|
32
|
+
sw: number;
|
|
33
|
+
sh: number;
|
|
34
|
+
/** Destination rect within the box, in CSS pixels (integers, abutting). */
|
|
35
|
+
dx: number;
|
|
36
|
+
dy: number;
|
|
37
|
+
dw: number;
|
|
38
|
+
dh: number;
|
|
17
39
|
}
|
|
18
40
|
/**
|
|
19
41
|
* The insets that actually apply for the entry's mode: a 3-slice mode zeroes out
|
|
20
42
|
* the axis it does not use (and `one` uses none at all), so callers never have
|
|
21
43
|
* to special-case the mode.
|
|
22
44
|
*/
|
|
23
|
-
declare function effectiveInsets(entry: SliceManifestEntry): SliceInsets;
|
|
45
|
+
export declare function effectiveInsets(entry: SliceManifestEntry): SliceInsets;
|
|
24
46
|
/**
|
|
25
47
|
* The overdraw that actually applies: zeros when absent, clamped so a core of at
|
|
26
48
|
* least one source pixel remains on each axis.
|
|
27
49
|
*/
|
|
28
|
-
declare function effectiveOverdraw(entry: SliceManifestEntry): SliceInsets;
|
|
50
|
+
export declare function effectiveOverdraw(entry: SliceManifestEntry): SliceInsets;
|
|
29
51
|
/**
|
|
30
52
|
* The overdraw's per-side destination size in CSS pixels for a box — how far the
|
|
31
53
|
* painted slice extends past the layout box on each side. Rounded to integers so
|
|
@@ -34,7 +56,7 @@ declare function effectiveOverdraw(entry: SliceManifestEntry): SliceInsets;
|
|
|
34
56
|
* the caps: box cross-axis ÷ the layout box (image minus overdraw). In `one`
|
|
35
57
|
* mode the image stretches per axis, so each axis scales independently.
|
|
36
58
|
*/
|
|
37
|
-
declare function computeOverdrawDestination(entry: SliceManifestEntry, boxWidth: number, boxHeight: number): SliceInsets;
|
|
59
|
+
export declare function computeOverdrawDestination(entry: SliceManifestEntry, boxWidth: number, boxHeight: number): SliceInsets;
|
|
38
60
|
/**
|
|
39
61
|
* How the canvas backend's `<canvas>` relates to the layout box: with overdraw
|
|
40
62
|
* the canvas is enlarged by the overdraw's destination size and offset
|
|
@@ -44,32 +66,30 @@ declare function computeOverdrawDestination(entry: SliceManifestEntry, boxWidth:
|
|
|
44
66
|
* origin sits at the layout box's top-left in device pixels — so the (possibly
|
|
45
67
|
* negative) cell coordinates from `computeRenderCells` apply directly.
|
|
46
68
|
*/
|
|
47
|
-
interface CanvasPaintLayout {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
69
|
+
export interface CanvasPaintLayout {
|
|
70
|
+
/** CSS offset of the canvas within the wrapper (0 or negative — overdraw). */
|
|
71
|
+
cssLeft: number;
|
|
72
|
+
cssTop: number;
|
|
73
|
+
/** CSS size of the canvas (box expanded by the overdraw's destination size). */
|
|
74
|
+
cssWidth: number;
|
|
75
|
+
cssHeight: number;
|
|
76
|
+
/** Backing-store size in device pixels (CSS size × devicePixelRatio). */
|
|
77
|
+
backingWidth: number;
|
|
78
|
+
backingHeight: number;
|
|
79
|
+
/** Paint origin (the layout box's top-left) in device pixels. */
|
|
80
|
+
originX: number;
|
|
81
|
+
originY: number;
|
|
60
82
|
}
|
|
61
83
|
/**
|
|
62
84
|
* The canvas geometry for a slice filling a `boxWidth × boxHeight` layout box
|
|
63
85
|
* at the given `devicePixelRatio` (the display's, not the asset's export
|
|
64
86
|
* scale). Pure — the canvas backend derives every size and offset from this.
|
|
65
87
|
*/
|
|
66
|
-
declare function computeCanvasPaintLayout(entry: SliceManifestEntry, boxWidth: number, boxHeight: number, devicePixelRatio: number): CanvasPaintLayout;
|
|
88
|
+
export declare function computeCanvasPaintLayout(entry: SliceManifestEntry, boxWidth: number, boxHeight: number, devicePixelRatio: number): CanvasPaintLayout;
|
|
67
89
|
/**
|
|
68
90
|
* Compute the cells to paint for a slice filling a `boxWidth × boxHeight` box.
|
|
69
91
|
* Returns an empty array for a zero-size box. With overdraw the cells cover the
|
|
70
92
|
* box expanded by `computeOverdrawDestination` on each side, so `dx`/`dy` can be
|
|
71
93
|
* negative and cells can extend past the box.
|
|
72
94
|
*/
|
|
73
|
-
declare function computeRenderCells(entry: SliceManifestEntry, boxWidth: number, boxHeight: number): RenderCell[];
|
|
74
|
-
//#endregion
|
|
75
|
-
export { CanvasPaintLayout, RenderCell, computeCanvasPaintLayout, computeOverdrawDestination, computeRenderCells, effectiveInsets, effectiveOverdraw };
|
|
95
|
+
export declare function computeRenderCells(entry: SliceManifestEntry, boxWidth: number, boxHeight: number): RenderCell[];
|
package/dist/runtime/geometry.js
CHANGED
|
@@ -1,209 +1,204 @@
|
|
|
1
|
-
import { createZeroInsets, slicedAxesFor } from
|
|
2
|
-
//#region src/geometry.ts
|
|
1
|
+
import { createZeroInsets, slicedAxesFor } from '../core/index.js';
|
|
3
2
|
function clamp(value, min, max) {
|
|
4
|
-
|
|
3
|
+
return Math.max(min, Math.min(max, value));
|
|
5
4
|
}
|
|
6
5
|
/**
|
|
7
|
-
* The insets that actually apply for the entry's mode: a 3-slice mode zeroes out
|
|
8
|
-
* the axis it does not use (and `one` uses none at all), so callers never have
|
|
9
|
-
* to special-case the mode.
|
|
10
|
-
*/
|
|
11
|
-
function effectiveInsets(entry) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
* The insets that actually apply for the entry's mode: a 3-slice mode zeroes out
|
|
7
|
+
* the axis it does not use (and `one` uses none at all), so callers never have
|
|
8
|
+
* to special-case the mode.
|
|
9
|
+
*/
|
|
10
|
+
export function effectiveInsets(entry) {
|
|
11
|
+
const { mode, insets } = entry.slicing;
|
|
12
|
+
const axes = slicedAxesFor(mode);
|
|
13
|
+
return {
|
|
14
|
+
top: axes.vertical ? insets.top : 0,
|
|
15
|
+
bottom: axes.vertical ? insets.bottom : 0,
|
|
16
|
+
left: axes.horizontal ? insets.left : 0,
|
|
17
|
+
right: axes.horizontal ? insets.right : 0
|
|
18
|
+
};
|
|
20
19
|
}
|
|
21
20
|
/**
|
|
22
|
-
* The overdraw that actually applies: zeros when absent, clamped so a core of at
|
|
23
|
-
* least one source pixel remains on each axis.
|
|
24
|
-
*/
|
|
25
|
-
function effectiveOverdraw(entry) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
left
|
|
38
|
-
};
|
|
21
|
+
* The overdraw that actually applies: zeros when absent, clamped so a core of at
|
|
22
|
+
* least one source pixel remains on each axis.
|
|
23
|
+
*/
|
|
24
|
+
export function effectiveOverdraw(entry) {
|
|
25
|
+
const overdraw = entry.slicing.overdraw;
|
|
26
|
+
if (!overdraw)
|
|
27
|
+
return createZeroInsets();
|
|
28
|
+
// Mirrors core's authoring `maxOverdraw` bound; this survives hand-edited libraries.
|
|
29
|
+
const width = entry.sourceWidth;
|
|
30
|
+
const height = entry.sourceHeight;
|
|
31
|
+
const left = clamp(overdraw.left, 0, Math.max(0, width - 1));
|
|
32
|
+
const right = clamp(overdraw.right, 0, Math.max(0, width - left - 1));
|
|
33
|
+
const top = clamp(overdraw.top, 0, Math.max(0, height - 1));
|
|
34
|
+
const bottom = clamp(overdraw.bottom, 0, Math.max(0, height - top - 1));
|
|
35
|
+
return { top, right, bottom, left };
|
|
39
36
|
}
|
|
40
37
|
/**
|
|
41
|
-
* The layout box — the image minus its effective overdraw — in **source pixels**
|
|
42
|
-
* Never smaller than one source pixel per axis (`effectiveOverdraw` guarantees
|
|
43
|
-
* a remaining box).
|
|
44
|
-
*/
|
|
38
|
+
* The layout box — the image minus its effective overdraw — in **source pixels**
|
|
39
|
+
* Never smaller than one source pixel per axis (`effectiveOverdraw` guarantees
|
|
40
|
+
* a remaining box).
|
|
41
|
+
*/
|
|
45
42
|
function sourceLayoutSize(entry) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
const overdraw = effectiveOverdraw(entry);
|
|
44
|
+
return {
|
|
45
|
+
width: Math.max(1, entry.sourceWidth - overdraw.left - overdraw.right),
|
|
46
|
+
height: Math.max(1, entry.sourceHeight - overdraw.top - overdraw.bottom)
|
|
47
|
+
};
|
|
51
48
|
}
|
|
52
49
|
/**
|
|
53
|
-
* The overdraw's per-side destination size in CSS pixels for a box — how far the
|
|
54
|
-
* painted slice extends past the layout box on each side. Rounded to integers so
|
|
55
|
-
* cells keep abutting on integer pixels. For a 9-slice the overdraw is a fixed
|
|
56
|
-
* band (÷ `pixelRatio`, like the corners); for the 3-slice modes it scales with
|
|
57
|
-
* the caps: box cross-axis ÷ the layout box (image minus overdraw). In `one`
|
|
58
|
-
* mode the image stretches per axis, so each axis scales independently.
|
|
59
|
-
*/
|
|
60
|
-
function computeOverdrawDestination(entry, boxWidth, boxHeight) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
50
|
+
* The overdraw's per-side destination size in CSS pixels for a box — how far the
|
|
51
|
+
* painted slice extends past the layout box on each side. Rounded to integers so
|
|
52
|
+
* cells keep abutting on integer pixels. For a 9-slice the overdraw is a fixed
|
|
53
|
+
* band (÷ `pixelRatio`, like the corners); for the 3-slice modes it scales with
|
|
54
|
+
* the caps: box cross-axis ÷ the layout box (image minus overdraw). In `one`
|
|
55
|
+
* mode the image stretches per axis, so each axis scales independently.
|
|
56
|
+
*/
|
|
57
|
+
export function computeOverdrawDestination(entry, boxWidth, boxHeight) {
|
|
58
|
+
const overdraw = effectiveOverdraw(entry);
|
|
59
|
+
if (overdraw.top === 0 && overdraw.right === 0 && overdraw.bottom === 0 && overdraw.left === 0) {
|
|
60
|
+
return overdraw;
|
|
61
|
+
}
|
|
62
|
+
const pixelRatio = entry.slicing.pixelRatio > 0 ? entry.slicing.pixelRatio : 1;
|
|
63
|
+
const sourceLayout = sourceLayoutSize(entry);
|
|
64
|
+
let horizontalScale;
|
|
65
|
+
let verticalScale;
|
|
66
|
+
if (entry.slicing.mode === 'three-horizontal') {
|
|
67
|
+
horizontalScale = verticalScale = boxHeight / sourceLayout.height;
|
|
68
|
+
}
|
|
69
|
+
else if (entry.slicing.mode === 'three-vertical') {
|
|
70
|
+
horizontalScale = verticalScale = boxWidth / sourceLayout.width;
|
|
71
|
+
}
|
|
72
|
+
else if (entry.slicing.mode === 'one') {
|
|
73
|
+
horizontalScale = boxWidth / sourceLayout.width;
|
|
74
|
+
verticalScale = boxHeight / sourceLayout.height;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
horizontalScale = verticalScale = 1 / pixelRatio;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
top: Math.round(overdraw.top * verticalScale),
|
|
81
|
+
right: Math.round(overdraw.right * horizontalScale),
|
|
82
|
+
bottom: Math.round(overdraw.bottom * verticalScale),
|
|
83
|
+
left: Math.round(overdraw.left * horizontalScale)
|
|
84
|
+
};
|
|
79
85
|
}
|
|
80
86
|
/**
|
|
81
|
-
* The canvas geometry for a slice filling a `boxWidth × boxHeight` layout box
|
|
82
|
-
* at the given `devicePixelRatio` (the display's, not the asset's export
|
|
83
|
-
* scale). Pure — the canvas backend derives every size and offset from this.
|
|
84
|
-
*/
|
|
85
|
-
function computeCanvasPaintLayout(entry, boxWidth, boxHeight, devicePixelRatio) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
87
|
+
* The canvas geometry for a slice filling a `boxWidth × boxHeight` layout box
|
|
88
|
+
* at the given `devicePixelRatio` (the display's, not the asset's export
|
|
89
|
+
* scale). Pure — the canvas backend derives every size and offset from this.
|
|
90
|
+
*/
|
|
91
|
+
export function computeCanvasPaintLayout(entry, boxWidth, boxHeight, devicePixelRatio) {
|
|
92
|
+
const overdrawDestination = computeOverdrawDestination(entry, boxWidth, boxHeight);
|
|
93
|
+
const cssWidth = boxWidth + overdrawDestination.left + overdrawDestination.right;
|
|
94
|
+
const cssHeight = boxHeight + overdrawDestination.top + overdrawDestination.bottom;
|
|
95
|
+
return {
|
|
96
|
+
// `+ 0` normalizes the negative zero a zero overdraw would produce.
|
|
97
|
+
cssLeft: -overdrawDestination.left + 0,
|
|
98
|
+
cssTop: -overdrawDestination.top + 0,
|
|
99
|
+
cssWidth,
|
|
100
|
+
cssHeight,
|
|
101
|
+
backingWidth: Math.round(cssWidth * devicePixelRatio),
|
|
102
|
+
backingHeight: Math.round(cssHeight * devicePixelRatio),
|
|
103
|
+
originX: overdrawDestination.left * devicePixelRatio,
|
|
104
|
+
originY: overdrawDestination.top * devicePixelRatio
|
|
105
|
+
};
|
|
99
106
|
}
|
|
100
107
|
/** Cumulative, rounded edges so adjacent cells abut exactly on integer pixels. */
|
|
101
108
|
function cumulativeEdges(sizes) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
let accumulated = 0;
|
|
110
|
+
const edges = [0];
|
|
111
|
+
for (const size of sizes) {
|
|
112
|
+
accumulated += size;
|
|
113
|
+
edges.push(Math.round(accumulated));
|
|
114
|
+
}
|
|
115
|
+
return edges;
|
|
109
116
|
}
|
|
110
117
|
/**
|
|
111
|
-
* Compute the cells to paint for a slice filling a `boxWidth × boxHeight` box.
|
|
112
|
-
* Returns an empty array for a zero-size box. With overdraw the cells cover the
|
|
113
|
-
* box expanded by `computeOverdrawDestination` on each side, so `dx`/`dy` can be
|
|
114
|
-
* negative and cells can extend past the box.
|
|
115
|
-
*/
|
|
116
|
-
function computeRenderCells(entry, boxWidth, boxHeight) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
sy: sourceRowStarts[row],
|
|
198
|
-
sw,
|
|
199
|
-
sh,
|
|
200
|
-
dx: dx - overdrawDestination.left,
|
|
201
|
-
dy: dy - overdrawDestination.top,
|
|
202
|
-
dw,
|
|
203
|
-
dh
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
return cells;
|
|
118
|
+
* Compute the cells to paint for a slice filling a `boxWidth × boxHeight` box.
|
|
119
|
+
* Returns an empty array for a zero-size box. With overdraw the cells cover the
|
|
120
|
+
* box expanded by `computeOverdrawDestination` on each side, so `dx`/`dy` can be
|
|
121
|
+
* negative and cells can extend past the box.
|
|
122
|
+
*/
|
|
123
|
+
export function computeRenderCells(entry, boxWidth, boxHeight) {
|
|
124
|
+
if (boxWidth <= 0 || boxHeight <= 0)
|
|
125
|
+
return [];
|
|
126
|
+
// Render into a virtual box expanded by the overdraw, then shift every cell
|
|
127
|
+
// back so the element core lands exactly in the layout box.
|
|
128
|
+
const overdrawDestination = computeOverdrawDestination(entry, boxWidth, boxHeight);
|
|
129
|
+
const paintWidth = boxWidth + overdrawDestination.left + overdrawDestination.right;
|
|
130
|
+
const paintHeight = boxHeight + overdrawDestination.top + overdrawDestination.bottom;
|
|
131
|
+
const width = entry.sourceWidth;
|
|
132
|
+
const height = entry.sourceHeight;
|
|
133
|
+
const pixelRatio = entry.slicing.pixelRatio > 0 ? entry.slicing.pixelRatio : 1;
|
|
134
|
+
const mode = entry.slicing.mode;
|
|
135
|
+
const insets = effectiveInsets(entry);
|
|
136
|
+
const left = clamp(insets.left, 0, width);
|
|
137
|
+
const right = clamp(insets.right, 0, Math.max(0, width - left));
|
|
138
|
+
const top = clamp(insets.top, 0, height);
|
|
139
|
+
const bottom = clamp(insets.bottom, 0, Math.max(0, height - top));
|
|
140
|
+
const centerWidth = Math.max(0, width - left - right);
|
|
141
|
+
const centerHeight = Math.max(0, height - top - bottom);
|
|
142
|
+
// Horizontal dest sizes for [left, center, right].
|
|
143
|
+
let leftDestination;
|
|
144
|
+
let rightDestination;
|
|
145
|
+
if (mode === 'three-horizontal') {
|
|
146
|
+
// Caps fill the box height (cross axis), scaling uniformly to keep aspect.
|
|
147
|
+
const scale = paintHeight / height;
|
|
148
|
+
leftDestination = left * scale;
|
|
149
|
+
rightDestination = right * scale;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
// 9-slice: fixed corners at logical size. three-vertical: left = right = 0.
|
|
153
|
+
leftDestination = left / pixelRatio;
|
|
154
|
+
rightDestination = right / pixelRatio;
|
|
155
|
+
}
|
|
156
|
+
const centerDestinationWidth = Math.max(0, paintWidth - leftDestination - rightDestination);
|
|
157
|
+
// Vertical dest sizes for [top, center, bottom].
|
|
158
|
+
let topDestination;
|
|
159
|
+
let bottomDestination;
|
|
160
|
+
if (mode === 'three-vertical') {
|
|
161
|
+
// Caps fill the box width (cross axis), scaling uniformly to keep aspect.
|
|
162
|
+
const scale = paintWidth / width;
|
|
163
|
+
topDestination = top * scale;
|
|
164
|
+
bottomDestination = bottom * scale;
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
topDestination = top / pixelRatio;
|
|
168
|
+
bottomDestination = bottom / pixelRatio;
|
|
169
|
+
}
|
|
170
|
+
const centerDestinationHeight = Math.max(0, paintHeight - topDestination - bottomDestination);
|
|
171
|
+
const sourceColumns = [left, centerWidth, right];
|
|
172
|
+
const sourceRows = [top, centerHeight, bottom];
|
|
173
|
+
const sourceColumnStarts = [0, left, left + centerWidth];
|
|
174
|
+
const sourceRowStarts = [0, top, top + centerHeight];
|
|
175
|
+
const columnEdges = cumulativeEdges([leftDestination, centerDestinationWidth, rightDestination]);
|
|
176
|
+
const rowEdges = cumulativeEdges([topDestination, centerDestinationHeight, bottomDestination]);
|
|
177
|
+
const cells = [];
|
|
178
|
+
for (let row = 0; row < 3; row++) {
|
|
179
|
+
for (let column = 0; column < 3; column++) {
|
|
180
|
+
const sw = sourceColumns[column];
|
|
181
|
+
const sh = sourceRows[row];
|
|
182
|
+
if (sw <= 0 || sh <= 0)
|
|
183
|
+
continue;
|
|
184
|
+
const dx = columnEdges[column];
|
|
185
|
+
const dw = columnEdges[column + 1] - dx;
|
|
186
|
+
const dy = rowEdges[row];
|
|
187
|
+
const dh = rowEdges[row + 1] - dy;
|
|
188
|
+
if (dw <= 0 || dh <= 0)
|
|
189
|
+
continue;
|
|
190
|
+
cells.push({
|
|
191
|
+
key: `${row}-${column}`,
|
|
192
|
+
sx: sourceColumnStarts[column],
|
|
193
|
+
sy: sourceRowStarts[row],
|
|
194
|
+
sw,
|
|
195
|
+
sh,
|
|
196
|
+
dx: dx - overdrawDestination.left,
|
|
197
|
+
dy: dy - overdrawDestination.top,
|
|
198
|
+
dw,
|
|
199
|
+
dh
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return cells;
|
|
207
204
|
}
|
|
208
|
-
//#endregion
|
|
209
|
-
export { computeCanvasPaintLayout, computeOverdrawDestination, computeRenderCells, effectiveInsets, effectiveOverdraw };
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export {
|
|
1
|
+
export { Manifest, createManifest } from './manifest.js';
|
|
2
|
+
export { default as Image } from './components/Image.svelte';
|
|
3
|
+
export { default as Slice } from './components/Slice.svelte';
|
|
4
|
+
export { default as Video } from './components/Video.svelte';
|
|
5
|
+
export { default as ChromaKeyVideo } from './components/ChromaKeyVideo.svelte';
|
|
6
|
+
export { resolveRetainedSource } from './preload-registry.js';
|
|
7
|
+
export { audioSourceOf } from './kind-handlers.js';
|
|
8
|
+
export type { ImageManifestEntry, SliceManifestEntry, VideoManifestEntry, ChromaKeyVideoManifestEntry, AudioManifestEntry, ManifestEntry, ChromaKeyParameters, ImagePreloadOptions, SlicePreloadOptions, VideoPreloadOptions, ChromaKeyVideoPreloadOptions, AudioPreloadOptions, PreloadOptions } from '../core/index.js';
|
|
9
|
+
export { DEFAULT_CHROMA_KEY_PARAMETERS } from '../core/index.js';
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export {
|
|
1
|
+
// Supported host-facing manifest and rendering APIs for the `fundus` root export.
|
|
2
|
+
export { Manifest, createManifest } from './manifest.js';
|
|
3
|
+
export { default as Image } from './components/Image.svelte';
|
|
4
|
+
export { default as Slice } from './components/Slice.svelte';
|
|
5
|
+
export { default as Video } from './components/Video.svelte';
|
|
6
|
+
export { default as ChromaKeyVideo } from './components/ChromaKeyVideo.svelte';
|
|
7
|
+
export { resolveRetainedSource } from './preload-registry.js';
|
|
8
|
+
export { audioSourceOf } from './kind-handlers.js';
|
|
9
|
+
export { DEFAULT_CHROMA_KEY_PARAMETERS } from '../core/index.js';
|