Skip to content

Commit

Permalink
perf: 完善对象
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBeard30 committed Mar 12, 2024
1 parent a6363c6 commit d08cfc9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/app/core/drivers/drag-drop-driver.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { EventDriver } from '../../shared/event';
import { Engine } from '../models';

export class DragDropDriver extends EventDriver<Engine> {
mouseDownTimer = null;

startEvent: MouseEvent;
}
2 changes: 1 addition & 1 deletion src/app/core/externals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ export const isBehaviorHost = (val: any): val is IBehaviorHost => val?.Behavior
export const isBehaviorList = (val: any): val is IBehavior[] => Array.isArray(val) && val.every(isBehavior);

export const createDesigner = () => {
return new Engine();
// return new Engine();
};
7 changes: 7 additions & 0 deletions src/app/core/models/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { uid } from '@/app/shared/uid';
import { TreeNode } from '@/app/core/models/tree-node';
import { Event } from '@/app/shared/event';

/**
* 设计器引擎
*/
export class Engine extends Event {
id: string;

Expand Down Expand Up @@ -36,6 +39,10 @@ export class Engine extends Event {
// this.keyboard = new Keyboard(this)
}

findNodeById(id: string) {
return TreeNode.findById(id);
}

findMovingNodes(): TreeNode[] {
const results = [];
this.workbench.eachWorkspace(workspace => {
Expand Down

0 comments on commit d08cfc9

Please sign in to comment.