优化:避免更改标注尺寸时无法正确的响应撤销重做

pull/1505/MERGE
ChenX 3 years ago
parent 59a50aaf5f
commit 7f99c732ea

@ -79,9 +79,9 @@ export class HistoricManage extends CADObject
{
ReportErrorWrap.ReportError(new Error().stack, "命令未执行中,但是却产生了错误了记录!");
Toaster({
message: "程序内部错误!命令未执行中,但是却产生了错误了记录! (请与我们联系,将错误报告给我们)",
message: "警告:命令未执行中,但是却产生了错误了历史记录! (不会造成图纸错误,但是会影响撤销(Ctrl+Z)重做(Ctrl+Y),请与我们联系,将错误报告给我们)",
timeout: 5000,
intent: Intent.DANGER,
intent: Intent.WARNING,
key: "no_command_his"
});
}

@ -10,7 +10,9 @@ import { safeEval } from "../../../Common/eval";
import { KeyBoard, KeyCode } from "../../../Common/KeyEnum";
import { digitStrReg } from "../../../Common/Utils";
import { AlignedDimension } from "../../../DatabaseServices/Dimension/AlignedDimension";
import { CommandWrap } from "../../../Editor/CommandMachine";
import { commandMachine, CommandWrap } from "../../../Editor/CommandMachine";
import { CommandState } from "../../../Editor/CommandState";
import { AppToaster } from "../Toaster";
import { PropertiesStore } from "./PropertiesStore";
export interface Properties_DimPanelProps
{
@ -210,6 +212,19 @@ export class Properties_DimPanel extends React.Component<Properties_DimPanelProp
labelStepSize={25}
onChange={(value) =>
{
if (!CommandState.CommandIng)
commandMachine.CommandStart("更改标注文字尺寸");
else
if (app.Database.hm.UndoData.CommandName !== "更改标注文字尺寸")
{
AppToaster.show({
message: "命令执行中,无法修改标注尺寸!",
timeout: 5000,
intent: Intent.WARNING,
}, "change_dim_text");
return false;
}
this.numericInputVal = value.toString();
this.dim_TextSize = value;
for (let al of ents)
@ -218,6 +233,11 @@ export class Properties_DimPanel extends React.Component<Properties_DimPanelProp
}
}}
value={this.dim_TextSize}
onRelease={() =>
{
if (CommandState.CommandIng && app.Database.hm.UndoData.CommandName === "更改标注文字尺寸")
commandMachine.CommandEnd();
}}
vertical={false}
/>
</li>

@ -24,7 +24,6 @@ export class Properties_Text extends React.Component<Properties_TextProps, {}>
componentDidMount()
{
let propsStore = PropertiesStore.GetInstance() as PropertiesStore;
let selectCtrl = app.Editor.SelectCtrl;
propsStore.isWorking = true;
let numval = this.props.ents[0].Height;
this.dim_TextSize = numval;

Loading…
Cancel
Save