wip
This commit is contained in:
43
stores/previewStore.ts
Normal file
43
stores/previewStore.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { DraggablePropsType } from "@/components/Draggable/Draggable";
|
||||
import { makeAutoObservable } from "mobx";
|
||||
|
||||
class PreviewStore {
|
||||
width: number = 0;
|
||||
height: number = 0;
|
||||
x: number = 0;
|
||||
y: number = 0;
|
||||
|
||||
constructor() {
|
||||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
changePreview(x: number, y: number, width: number, height: number) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
changePreviewX(x: number) {
|
||||
this.x = x;
|
||||
}
|
||||
changePreviewY(y: number) {
|
||||
this.y = y;
|
||||
}
|
||||
changePreviewWidth(width: number) {
|
||||
this.width = width;
|
||||
}
|
||||
changePreviewHeight(height: number) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
clearPreview() {
|
||||
this.width = 0;
|
||||
this.height = 0;
|
||||
this.x = 0;
|
||||
this.y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default new PreviewStore();
|
||||
Reference in New Issue
Block a user