0.17.0: split SVG layer into per-path layers

Right-click an SVG-backed layer to split it into one layer per
top-level drawable. Each part keeps the original stage position
and ends up as a same-size standalone SVG.

Also: delete confirm now floats above the welcome dialog (topmost
z-index + scoped ESC/Tab via modal stack) and autofocuses its
primary button so Enter triggers confirm instead of bubbling back
to the underlying row.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
thandClaude Opus 4.7 committed 2026-04-24 12:26:57 +02:00
1 parent baf775c8de
commit a858f94bb7
10 files changed
+887 -84

No files matched your search

+30
View File
@@ -24,6 +24,7 @@ import {
PhPencilSimpleLine,
PhPlus,
PhPolygon,
PhScissors,
PhSpeakerSlash,
PhSquare,
PhTextT,
@@ -2683,6 +2684,26 @@ function convertSelectedToClipFromMenu() {
trackMenu.value = null
}
/** True only for a context-menu tied to an SVG-backed image layer.
* Gates the "Split SVG" entry so the menu doesn't show a dead action
* on raster layers. */
const canSplitSvgFromMenu = computed(() => {
const m = trackMenu.value
if (!m || m.kind !== 'layer') return false
const layer = store.scene.layers.find((l) => l.id === m.trackId)
if (!layer) return false
const asset = store.scene.assets.find((a) => a.id === layer.assetId)
if (!asset || asset.kind !== 'image') return false
return asset.src.startsWith('data:image/svg+xml')
})
function splitSvgFromMenu() {
const m = trackMenu.value
if (!m || m.kind !== 'layer') return
store.splitLayerSvg(m.trackId)
trackMenu.value = null
}
function deleteTrack() {
if (!trackMenu.value) return
if (trackMenu.value.kind === 'layer') {
@@ -3976,6 +3997,15 @@ onBeforeUnmount(() => {
<PhFilmStrip :size="12" class="kf-menu-icon" />
{{ t('timeline.convertToClip', { n: store.selectedLayerIds.length }) }}
</button>
<button
v-if="canSplitSvgFromMenu"
class="kf-menu-item"
:disabled="trackMenu.locked"
@click="splitSvgFromMenu"
>
<PhScissors :size="12" class="kf-menu-icon" />
{{ t('timeline.splitSvg') }}
</button>
</template>
</template>
<template v-if="trackMenu.kind !== 'group'">