|
|
@ -1,4 +1,5 @@
|
|
|
|
import { Checkbox, FormGroup, Intent, Label, NumericInput, Slider } from "@blueprintjs/core";
|
|
|
|
import { Checkbox, FormGroup, Intent, Label, NumericInput, Slider } from "@blueprintjs/core";
|
|
|
|
|
|
|
|
import { observable } from "mobx";
|
|
|
|
import { observer } from "mobx-react";
|
|
|
|
import { observer } from "mobx-react";
|
|
|
|
import React from "react";
|
|
|
|
import React from "react";
|
|
|
|
import { Entitys2Data } from "../../../Add-on/ExportData";
|
|
|
|
import { Entitys2Data } from "../../../Add-on/ExportData";
|
|
|
@ -10,9 +11,14 @@ import { userConfig } from "../../../Editor/UserConfig";
|
|
|
|
import { LightStore } from "../../Store/RightPanelStore/LightStore";
|
|
|
|
import { LightStore } from "../../Store/RightPanelStore/LightStore";
|
|
|
|
import { AppToaster } from "../Toaster";
|
|
|
|
import { AppToaster } from "../Toaster";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//天光曝光
|
|
|
|
|
|
|
|
const AMEXP_MIN = - 3;
|
|
|
|
|
|
|
|
const AMEXP_MAX = 6;
|
|
|
|
|
|
|
|
|
|
|
|
@observer
|
|
|
|
@observer
|
|
|
|
export class ExposureUI extends React.Component<{ store: LightStore; }, {}>
|
|
|
|
export class ExposureUI extends React.Component<{ store: LightStore; }, {}>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
@observable _InputExposureCompensation: string = this.props.store.hemisphereLightData.ExposureCompensation;
|
|
|
|
async SetExposureCompensation(val: number)
|
|
|
|
async SetExposureCompensation(val: number)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const KEY = '修改曝光补偿';
|
|
|
|
const KEY = '修改曝光补偿';
|
|
|
@ -43,6 +49,7 @@ export class ExposureUI extends React.Component<{ store: LightStore; }, {}>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
render()
|
|
|
|
render()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
let expValue = this.props.store.hemisphereLightData.ExposureCompensation;
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div id='ExposureUI'>
|
|
|
|
<div id='ExposureUI'>
|
|
|
|
<Checkbox
|
|
|
|
<Checkbox
|
|
|
@ -85,14 +92,29 @@ export class ExposureUI extends React.Component<{ store: LightStore; }, {}>
|
|
|
|
<Label>曝光补偿:</Label>
|
|
|
|
<Label>曝光补偿:</Label>
|
|
|
|
<NumericInput
|
|
|
|
<NumericInput
|
|
|
|
buttonPosition={"none"}
|
|
|
|
buttonPosition={"none"}
|
|
|
|
min={-3}
|
|
|
|
min={AMEXP_MIN}
|
|
|
|
max={6}
|
|
|
|
max={AMEXP_MAX}
|
|
|
|
stepSize={0.1}
|
|
|
|
stepSize={0.1}
|
|
|
|
value={(FixedNotZero(this.props.store.hemisphereLightData.ExposureCompensation, 1))}
|
|
|
|
value={this._InputExposureCompensation}
|
|
|
|
onValueChange={async (e) =>
|
|
|
|
onValueChange={async (num, value, e) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (value === "" || "-0.".includes(value) && value !== "0")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (isNaN(e) || e < -3 || e > 6) return;
|
|
|
|
this._InputExposureCompensation = value;
|
|
|
|
this.SetExposureCompensation(e);
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isNaN(num) || num < AMEXP_MIN || num > AMEXP_MAX) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (num >= AMEXP_MIN && num < AMEXP_MAX && value === num + ".")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (num === AMEXP_MIN) return; //MIN = -3 ,防止输入出现如( -3.)
|
|
|
|
|
|
|
|
this._InputExposureCompensation = value;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this._InputExposureCompensation = FixedNotZero(num, 1);
|
|
|
|
|
|
|
|
if (this._InputExposureCompensation === expValue) return; //等于原始值
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.SetExposureCompensation(num);
|
|
|
|
const KEY = '修改曝光补偿';
|
|
|
|
const KEY = '修改曝光补偿';
|
|
|
|
if (CommandState.CommandIng && app.Database.hm.UndoData.CommandName === KEY)
|
|
|
|
if (CommandState.CommandIng && app.Database.hm.UndoData.CommandName === KEY)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -107,16 +129,19 @@ export class ExposureUI extends React.Component<{ store: LightStore; }, {}>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
e.stopPropagation();
|
|
|
|
e.stopPropagation();
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
|
|
|
|
onBlur={(e) => { e.currentTarget.value = expValue; }}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<Slider
|
|
|
|
<Slider
|
|
|
|
showTrackFill={false}
|
|
|
|
showTrackFill={false}
|
|
|
|
min={-3}
|
|
|
|
min={AMEXP_MIN}
|
|
|
|
max={6}
|
|
|
|
max={AMEXP_MAX}
|
|
|
|
stepSize={0.1}
|
|
|
|
stepSize={0.1}
|
|
|
|
value={parseFloat(this.props.store.hemisphereLightData.ExposureCompensation)}
|
|
|
|
value={parseFloat(expValue)}
|
|
|
|
|
|
|
|
labelValues={[AMEXP_MIN, AMEXP_MAX]}
|
|
|
|
onChange={(val) =>
|
|
|
|
onChange={(val) =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.SetExposureCompensation(val);
|
|
|
|
this.SetExposureCompensation(val);
|
|
|
|
|
|
|
|
this._InputExposureCompensation = FixedNotZero(val, 1);
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
onRelease={() =>
|
|
|
|
onRelease={() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|