From 913c51264a73d3109692107fd512efda4edd35b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Tue, 1 Sep 2026 17:07:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=8E=E7=A1=AE=20Tiled=20fill=5Fcenter=20?= =?UTF-8?q?=E6=9A=82=E4=B8=8D=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在前端预览与 Rust HTML 渲染两侧保留 repeat fallback 并添加 TODO。 在 UI 编辑器布局契约中明确 Tiled.fill_center=false 当前不支持及后续迁移要求。 --- .../src-tauri/src/ui_editor/html_renderer/component/image.rs | 1 + .../src/features/ui-editor/utils/componentToCss.ts | 1 + .../【技术方案】UI编辑器Godot容器布局模型-2026-08-18.md | 1 + 3 files changed, 3 insertions(+) diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/html_renderer/component/image.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/html_renderer/component/image.rs index 1c3ffb5a4..6dcbb8d28 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/html_renderer/component/image.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/html_renderer/component/image.rs @@ -44,6 +44,7 @@ pub(in crate::ui_editor::html_renderer) fn image_styles( pixels_per_unit_multiplier, .. } => { + // TODO: Tiled.fill_center=false 当前暂不支持,保持整块 repeat fallback。 let w = finite_positive( sprite.pixel_size.x / (sprite.pixels_per_unit().get() * pixels_per_unit_multiplier.get()), diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/utils/componentToCss.ts b/apps/ai-game-creator-shell/src/features/ui-editor/utils/componentToCss.ts index 92ac8d202..2b80c682d 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/utils/componentToCss.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/utils/componentToCss.ts @@ -141,6 +141,7 @@ function imageTypeModel( const size = logicalSize(sprite, multiplier); if ('Tiled' in imageType) { + // TODO: Tiled.fill_center=false 当前暂不支持,保持浏览器 repeat fallback。 return { kind: 'background', src, diff --git a/docs/technical/【技术方案】UI编辑器Godot容器布局模型-2026-08-18.md b/docs/technical/【技术方案】UI编辑器Godot容器布局模型-2026-08-18.md index b7981c5bc..f9852c817 100644 --- a/docs/technical/【技术方案】UI编辑器Godot容器布局模型-2026-08-18.md +++ b/docs/technical/【技术方案】UI编辑器Godot容器布局模型-2026-08-18.md @@ -35,6 +35,7 @@ Container 专属数据是互斥 tagged union:HBox/VBox 存 `alignment + separa - 不支持 Flex/Flow wrap;Grid 按行优先排列。 - Margin 的 children 填满内侧矩形;Center 的 children 居中并可重叠。 - v1 minimum size 只使用 `custom_minimum_size`。TODO:为文本、图片等组件提供 minimum-size,再与 custom minimum 逐轴取最大值。 +- `ImageType::Tiled.fill_center=false` 当前暂不支持,前端预览与 Rust HTML 生成均保持整块 `repeat` fallback;如需实现仅铺边框,必须先补充 CSS 输出与既有项目迁移契约。 ## 编辑器交互