From 329bf1db06db119ee2b9f1296eb84fc79ff7af31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=89?= <940119273@qq.com> Date: Tue, 11 Jun 2024 08:39:36 +0000 Subject: [PATCH] =?UTF-8?q?!2811=20=E4=BC=98=E5=8C=96:=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E6=A0=8F=E5=A4=AA=E9=98=B3=E5=85=89=E5=85=89=E6=BA=90=E8=A7=92?= =?UTF-8?q?=E5=BA=A6UI=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UI/Components/INumericInput.tsx | 7 +++++-- src/UI/Components/RightPanel/RightPanel.less | 12 ++++-------- src/UI/Components/RightPanel/SunLightGui.tsx | 10 +++++----- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/UI/Components/INumericInput.tsx b/src/UI/Components/INumericInput.tsx index 759251d03..99ec5c75f 100644 --- a/src/UI/Components/INumericInput.tsx +++ b/src/UI/Components/INumericInput.tsx @@ -13,7 +13,7 @@ interface INumericInputProps max?: number; //最大值 stepSize?: number; float?: number; //保留小数位数 - onValueChange?: (valueAsNumber: number, valueAsString: string, inputElement: HTMLInputElement) => void; + onValueChange?: (valueAsNumber: number) => void; onBlur?: (e: React.FocusEvent) => void; //可以用来赋值使用 style?: React.CSSProperties; tooltip?: boolean; @@ -84,7 +84,7 @@ export class INumericInput extends React.Component } this._Value = parseFloat(FixedNotZero(num, this._Float)); if (this.props.onValueChange) - this.props.onValueChange(num, value, e); + this.props.onValueChange(this._Value); this._isPopoverOpen = false; }} onFocus={(e) => @@ -111,6 +111,9 @@ export class INumericInput extends React.Component { this._Value = this._CanNull ? "" : (this.props.min ?? 0).toString(); e.currentTarget.value = this._Value; + + if (!this._CanNull && this.props.onValueChange) + this.props.onValueChange(this.props.min); } if (this.props.onBlur) this.props.onBlur(e); diff --git a/src/UI/Components/RightPanel/RightPanel.less b/src/UI/Components/RightPanel/RightPanel.less index 75896ad27..968565ca2 100644 --- a/src/UI/Components/RightPanel/RightPanel.less +++ b/src/UI/Components/RightPanel/RightPanel.less @@ -202,18 +202,14 @@ } } - input { - margin-left: none; - } - .bp3-popover-wrapper { display: flex; align-items: center; + margin-left: auto; + } - button { - position: relative; - left: 151px; - } + :nth-child(2) { + margin: 0; } } diff --git a/src/UI/Components/RightPanel/SunLightGui.tsx b/src/UI/Components/RightPanel/SunLightGui.tsx index 1910b9a16..dbd072a4b 100644 --- a/src/UI/Components/RightPanel/SunLightGui.tsx +++ b/src/UI/Components/RightPanel/SunLightGui.tsx @@ -5,9 +5,10 @@ import { ColorResult, SketchPicker } from 'react-color'; import { Color, MathUtils, Matrix4, Vector3 } from 'three'; import { Entitys2Data } from '../../../Add-on/ExportData'; import { app } from '../../../ApplicationServices/Application'; -import { safeEval } from '../../../Common/eval'; import { ResourcesCDN_HOST } from '../../../Common/HostUrl'; import { CalcSunShadowCameraExtents } from '../../../Common/LightUtils'; +import { FixedNotZero } from '../../../Common/Utils'; +import { safeEval } from '../../../Common/eval'; import { commandMachine } from '../../../Editor/CommandMachine'; import { CommandState } from '../../../Editor/CommandState'; import { userConfig } from '../../../Editor/UserConfig'; @@ -397,7 +398,6 @@ export default class SunLightGui extends Component minimal placement='top' > -