Skip to content

Commit

Permalink
🎈 perf: the logic for highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangechen committed Dec 28, 2023
1 parent a8c1bb9 commit c3e03d5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/chili-vis/src/modelSelectionEventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,5 @@ export class ModelSelectionHandler extends SelectionHandler {
return this._models.size;
}

override clearSelected(document: IDocument): void {
document.selection.clearSelected();
}
override clearSelected(document: IDocument): void {}
}
5 changes: 5 additions & 0 deletions packages/chili/src/commands/create/createCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export abstract class CreateCommand extends MultistepCommand {
}

protected abstract create(): GeometryModel;

protected override beforeExecute(): Promise<boolean> {
this.document.selection.clearSelected();
return super.beforeExecute();
}
}

export abstract class CreateFaceableCommand extends CreateCommand {
Expand Down
1 change: 0 additions & 1 deletion packages/chili/src/step/step.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export abstract class StepBase<D extends ValidatorData> implements IStep {
) {}

async execute(document: IDocument, controller: AsyncController): Promise<SnapedData | undefined> {
document.selection.clearSelected();
let data = this.handleData();
if (data.validators === undefined) data.validators = [];
data.validators.push((point) => this.validator(data, point));
Expand Down

0 comments on commit c3e03d5

Please sign in to comment.