From a213f5b50389feafb8b288f4b4ddd75c968259a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Fri, 14 Aug 2026 13:13:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20Inspector=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调整输入框样式以提升可读性。 - 新增上下按钮与键盘上下箭头支持,用于调整数值变换。 - 修复数值格式化逻辑,提升输入精度控制。 - 增强只读模式的视觉提示与操作不可用状态。 --- .../Inspector/Transform/TransformEditor.tsx | 79 +++++++++++++------ 1 file changed, 53 insertions(+), 26 deletions(-) diff --git a/apps/ai-game-creator-shell/src/view/ui-editor/components/Inspector/Transform/TransformEditor.tsx b/apps/ai-game-creator-shell/src/view/ui-editor/components/Inspector/Transform/TransformEditor.tsx index ba9de6cff..f1cb9dda2 100644 --- a/apps/ai-game-creator-shell/src/view/ui-editor/components/Inspector/Transform/TransformEditor.tsx +++ b/apps/ai-game-creator-shell/src/view/ui-editor/components/Inspector/Transform/TransformEditor.tsx @@ -1,6 +1,7 @@ import { AlertTriangle, ChevronDown, + ChevronUp, Crosshair, LockKeyhole, Maximize2, @@ -170,7 +171,7 @@ function formatValue(value: number): string { if (Object.is(value, -0)) { return '0'; } - return String(Number(value.toFixed(4))); + return String(Number(value.toFixed(2))); } function VectorInputRow({ @@ -234,6 +235,17 @@ function ScalarInput({ setDraft(formatValue(next)); }; + const adjust = (direction: -1 | 1) => { + if (readOnly) { + return; + } + const current = Number(draft); + const base = Number.isFinite(current) ? current : value; + const next = Number((base + direction * step).toFixed(4)); + setDraft(formatValue(next)); + onCommit(next); + }; + return ( ); } @@ -314,7 +351,10 @@ export function TransformEditor({ geometry?.invalid; return ( -
+
@@ -328,17 +368,15 @@ export function TransformEditor({
{readOnly ? ( - + + ) : ( - + + )}
@@ -374,12 +412,12 @@ export function TransformEditor({ {presetOpen ? (
- + Anchor @@ -498,17 +536,6 @@ export function TransformEditor({ ) : null}
-
- - {AXIS_LABELS.map((axis) => ( - - {axis} - - ))} -