Normalize video canvas composer scaling
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-04-19 09:41:30 +08:00
parent 193b03d677
commit 3a4604286f

View File

@ -382,13 +382,11 @@ const OFFICIAL_NODE_GAP = 100;
const OFFICIAL_TEXT_RESOURCE_HEIGHT = 232; const OFFICIAL_TEXT_RESOURCE_HEIGHT = 232;
const OFFICIAL_TEXT_RESOURCE_WIDTH = 350; const OFFICIAL_TEXT_RESOURCE_WIDTH = 350;
const OFFICIAL_IMAGE_TOOLBAR_SCALE = 0.7; const OFFICIAL_IMAGE_TOOLBAR_SCALE = 0.7;
const OFFICIAL_COMPOSER_SCALE = 0.42; const OFFICIAL_COMPOSER_SCALE = 0.546;
const OFFICIAL_ZOOM_DOCK_SCALE = 0.5; const OFFICIAL_ZOOM_DOCK_SCALE = 0.65;
const PROMPT_COMPOSER_BASE_WIDTH = 895; const PROMPT_COMPOSER_BASE_WIDTH = 895;
const PROMPT_COMPOSER_BASE_HEIGHT = 286; const PROMPT_COMPOSER_BASE_HEIGHT = 286;
const PRESET_COMPOSER_BASE_HEIGHT = 238; const PRESET_COMPOSER_BASE_HEIGHT = 238;
const TEXT_MODULE_COMPOSER_WIDTH = 1274;
const TEXT_MODULE_COMPOSER_HEIGHT = 270;
const MULTI_VIEW_NINE_GRID_PROMPT = const MULTI_VIEW_NINE_GRID_PROMPT =
"以选中图片为角色/主体参考,生成多视角 3x3 九宫格分镜图。保持主体一致,九个镜头包含远景、全身、侧身、背面、半身、近景、局部细节等视角,使用清晰黑色分割线分隔每一格,白色或干净背景。"; "以选中图片为角色/主体参考,生成多视角 3x3 九宫格分镜图。保持主体一致,九个镜头包含远景、全身、侧身、背面、半身、近景、局部细节等视角,使用清晰黑色分割线分隔每一格,白色或干净背景。";
const NINE_GRID_CELL_VISUALS: GridCellVisual[] = [ const NINE_GRID_CELL_VISUALS: GridCellVisual[] = [
@ -4299,22 +4297,25 @@ function TextTargetModuleComposer({
className="pointer-events-auto absolute z-30 overflow-visible" className="pointer-events-auto absolute z-30 overflow-visible"
data-canvas-overlay="true" data-canvas-overlay="true"
style={{ style={{
height: TEXT_MODULE_COMPOSER_HEIGHT, height: PROMPT_COMPOSER_BASE_HEIGHT * OFFICIAL_COMPOSER_SCALE,
left: anchor.centerX, left: anchor.centerX,
top: anchor.bottomY + 24, top: anchor.bottomY + 24,
transform: "translateX(-50%)", transform: "translateX(-50%)",
width: TEXT_MODULE_COMPOSER_WIDTH, width: PROMPT_COMPOSER_BASE_WIDTH * OFFICIAL_COMPOSER_SCALE,
}} }}
> >
<div className="relative h-[270px] w-[1274px] rounded-[16px] border border-white/8 bg-[#262626]/98 p-6 text-white shadow-[0_24px_84px_rgba(0,0,0,0.48)]"> <div
className="relative h-[286px] w-[895px] rounded-[18px] border border-white/8 bg-[#262626]/98 p-5 text-white shadow-[0_24px_84px_rgba(0,0,0,0.48)]"
style={{ transform: `scale(${OFFICIAL_COMPOSER_SCALE})`, transformOrigin: "top left" }}
>
<textarea <textarea
className="h-[148px] w-full resize-none bg-transparent text-[24px] leading-[34px] text-white/74 outline-none placeholder:text-white/40" className="h-[158px] w-full resize-none bg-transparent text-[20px] leading-8 text-white/64 outline-none placeholder:text-white/38"
onChange={(event) => setPrompt(event.target.value)} onChange={(event) => setPrompt(event.target.value)}
onPointerDown={(event) => event.stopPropagation()} onPointerDown={(event) => event.stopPropagation()}
placeholder="写下你想讲的故事、场景或角色设定。例如:一个来自未来的机器人,在城市屋顶看星星。" placeholder="写下你想讲的故事、场景或角色设定。例如:一个来自未来的机器人,在城市屋顶看星星。"
value={prompt} value={prompt}
/> />
<div className="absolute bottom-5 left-6 right-[86px] flex items-center gap-8 overflow-hidden text-[24px] text-white/82"> <div className="absolute bottom-5 left-5 right-[84px] flex items-center gap-6 overflow-hidden text-[17px] text-white/78">
<ComposerControl <ComposerControl
label="GVLM 3.1" label="GVLM 3.1"
icon="⌘" icon="⌘"
@ -4326,7 +4327,7 @@ function TextTargetModuleComposer({
<ComposerControl label="6" icon="⚡" muted onClick={() => toast.info("积分估算接入本地积分系统。")} /> <ComposerControl label="6" icon="⚡" muted onClick={() => toast.info("积分估算接入本地积分系统。")} />
</div> </div>
<button <button
className="absolute bottom-5 right-5 flex h-14 w-14 items-center justify-center rounded-[14px] bg-white/76 text-[34px] leading-none text-black transition hover:bg-white" className="absolute bottom-5 right-5 flex h-11 w-11 items-center justify-center rounded-[12px] bg-white/76 text-[24px] leading-none text-black transition hover:bg-white"
onClick={() => onSubmit(prompt)} onClick={() => onSubmit(prompt)}
type="button" type="button"
> >