[FEAT] Add pixel editor
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user