完善快速编辑参考图与生成占位
- 快速编辑支持最多8张额外参考图,并将原图自动作为最后一张参考图提交 - 快速编辑尺寸和模型沿用原图配置,按禁用态参数胶囊展示 - 快速编辑提交前同步改写原图引用为实际图序号 - 快速编辑生成改为创建独立画布生成占位,并支持键盘删除生成中对象 - 对齐生成类面板参考图图标、规范类固定参数和相关文档测试
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type {
|
||||
EditorCharacterAnimationGenerationResult,
|
||||
EditorAudioGenerationResult,
|
||||
EditorCharacterAnimationGenerationResult,
|
||||
EditorIconSpritesheetGenerationResult,
|
||||
EditorIconSpritesheetIconResult,
|
||||
EditorImageGenerationResult,
|
||||
@@ -35,6 +35,7 @@ type QuickEditResultLayerOptions = {
|
||||
sourceLayer: CanvasLayer;
|
||||
generationInputs: CanvasGenerationInputs;
|
||||
mode?: 'quick-edit' | 'redraw';
|
||||
frame?: GenerateDialogState['placeholder'];
|
||||
};
|
||||
|
||||
type IconSpritesheetResultLayerOptions = {
|
||||
@@ -173,6 +174,7 @@ export function createQuickEditResultLayer({
|
||||
sourceLayer,
|
||||
generationInputs,
|
||||
mode = 'quick-edit',
|
||||
frame,
|
||||
}: QuickEditResultLayerOptions): CanvasLayer {
|
||||
const originalWidth = generated.width || sourceLayer.originalWidth || 1024;
|
||||
const originalHeight = generated.height || sourceLayer.originalHeight || 1024;
|
||||
@@ -184,6 +186,14 @@ export function createQuickEditResultLayer({
|
||||
height: sourceLayer.height,
|
||||
},
|
||||
);
|
||||
const frameX =
|
||||
frame && frame.width > 0
|
||||
? frame.x + frame.width / 2 - width / 2
|
||||
: undefined;
|
||||
const frameY =
|
||||
frame && frame.height > 0
|
||||
? frame.y + frame.height / 2 - height / 2
|
||||
: undefined;
|
||||
|
||||
return applyGeneratedMetadata(
|
||||
{
|
||||
@@ -191,8 +201,8 @@ export function createQuickEditResultLayer({
|
||||
resourceId: `local-resource-quick-edit-${generatedIndex}`,
|
||||
title: `${sourceLayer.title} ${mode === 'redraw' ? '重绘' : '快速编辑'}`,
|
||||
src: generated.imageSrc,
|
||||
x: sourceLayer.x + sourceLayer.width + 32,
|
||||
y: sourceLayer.y,
|
||||
x: frameX ?? sourceLayer.x + sourceLayer.width + 32,
|
||||
y: frameY ?? sourceLayer.y,
|
||||
width,
|
||||
height,
|
||||
originalWidth,
|
||||
|
||||
Reference in New Issue
Block a user