!2811 优化:右侧栏太阳光光源角度UI调整

pull/2809/MERGE
林三 4 months ago committed by ChenX
parent 3ddc651f99
commit 329bf1db06

@ -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<HTMLInputElement, Element>) => void; //可以用来赋值使用
style?: React.CSSProperties;
tooltip?: boolean;
@ -84,7 +84,7 @@ export class INumericInput extends React.Component<INumericInputProps, {}>
}
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<INumericInputProps, {}>
{
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);

@ -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;
}
}

@ -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'
>
<Button
minimal small
intent={Intent.PRIMARY}
@ -416,9 +416,8 @@ export default class SunLightGui extends Component
</FormGroup>
<FormGroup>
<div className='sun-light-angle'>
<Label>:</Label>
<Label>:</Label>
<INumericInput
style={{ marginLeft: "none" }}
min={0}
max={5}
float={4}
@ -444,7 +443,8 @@ export default class SunLightGui extends Component
value={this.store.sunLightSourceAngle}
onChange={async (val) =>
{
await this.SetSunLightSourceAngle(val);
let v = parseFloat(FixedNotZero(val, 4));
await this.SetSunLightSourceAngle(v);
app.Viewer.UpdateRender();
}}
onRelease={() =>

Loading…
Cancel
Save