mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 14:28:51 +08:00
bd59871c22
* fix edgeless edit bar tooltip * fix tooltip
35 lines
798 B
TypeScript
35 lines
798 B
TypeScript
// import { Draw } from '@toeverything/components/board-shapes';
|
|
|
|
import { BaseTool } from '@toeverything/components/board-state';
|
|
import { TDShapeType } from '@toeverything/components/board-types';
|
|
|
|
enum Status {
|
|
Idle = 'idle',
|
|
Pointing = 'pointing',
|
|
Draw = 'draw',
|
|
}
|
|
|
|
export class HandDragTool extends BaseTool {
|
|
override type = TDShapeType.HandDrag as const;
|
|
|
|
override status: Status = Status.Idle;
|
|
|
|
/* ----------------- Event Handlers ----------------- */
|
|
|
|
override onEnter = () => {
|
|
this.app.patchState({
|
|
settings: {
|
|
forcePanning: true,
|
|
},
|
|
});
|
|
};
|
|
|
|
override onExit = () => {
|
|
this.app.patchState({
|
|
settings: {
|
|
forcePanning: false,
|
|
},
|
|
});
|
|
};
|
|
}
|