fix: 对齐 getConfig 的实现

fix: 修复回退/重做后, 选中态丢失的问题
This commit is contained in:
力皓 2021-03-31 16:45:01 +08:00
parent 116dea168d
commit 7b551fb5b8
2 changed files with 10 additions and 2 deletions

View File

@ -172,7 +172,10 @@ hotkey.bind(['command+z', 'ctrl+z'], (e) => {
} }
e.preventDefault(); e.preventDefault();
const selection = focusing.focusDesigner?.currentSelection;
const curSelected = Array.from(selection?.selected!);
his.back(); his.back();
selection?.selectAll(curSelected);
}); });
// command + shift + z redo // command + shift + z redo
@ -183,8 +186,10 @@ hotkey.bind(['command+y', 'ctrl+y', 'command+shift+z'], (e) => {
return; return;
} }
e.preventDefault(); e.preventDefault();
const selection = focusing.focusDesigner?.currentSelection;
const curSelected = Array.from(selection?.selected!);
his.forward(); his.forward();
selection?.selectAll(curSelected);
}); });
// sibling selection // sibling selection

View File

@ -119,7 +119,10 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
// ======= compatibles for vision ====== // ======= compatibles for vision ======
getConfig(): FieldConfig { getConfig<K extends keyof FieldConfig>(configName?: K): FieldConfig[K] | FieldConfig {
if (configName) {
return this.config[configName];
}
return this._config; return this._config;
} }