[FEAT] Add pixel editor

This commit is contained in:
2026-01-03 17:17:14 +01:00
parent 224d0d62fe
commit 2f0404d698
6 changed files with 1007 additions and 5 deletions

View File

@@ -21,6 +21,10 @@
<i class="fas fa-copy text-cyan-600 dark:text-cyan-400 text-xs w-4"></i>
<span>Copy to Frame...</span>
</button>
<button @click="openPixelEditor" class="w-full px-3 py-1.5 text-left hover:bg-indigo-50 dark:hover:bg-indigo-900/30 text-gray-700 dark:text-gray-200 flex items-center gap-2 transition-colors text-sm">
<i class="fas fa-paint-brush text-indigo-600 dark:text-indigo-400 text-xs w-4"></i>
<span>Edit in Pixel Editor</span>
</button>
</div>
<!-- Copy to Frame Modal -->
@@ -299,6 +303,7 @@
(e: 'flipSprite', id: string, direction: 'horizontal' | 'vertical'): void;
(e: 'copySpriteToFrame', spriteId: string, targetLayerId: string, targetFrameIndex: number): void;
(e: 'replaceSprite', id: string, file: File): void;
(e: 'openPixelEditor', layerId: string, frameIndex: number): void;
}>();
const previewContainerRef = ref<HTMLDivElement | null>(null);
@@ -691,6 +696,13 @@
replacingSpriteId.value = null;
input.value = '';
};
const openPixelEditor = () => {
if (contextMenuSpriteId.value && contextMenuLayerId.value) {
emit('openPixelEditor', contextMenuLayerId.value, currentFrameIndex.value);
hideContextMenu();
}
};
</script>
<style scoped>