src/app/core/drawers/drawer-manager.js
import { stageManager as Stages } from "../application/stage-manager";
class DrawerManager {
constructor() {
this.currentStage = this._getCurrentStage();
}
_getCurrentStage() {
return Stages.getCurrentStage();
}
_getCurrentKonvaStage() {
return Stages.getCurrentKonvaStage();
}
getStages() {
return Stages.getStages();
}
draw(object) {
this.currentStage.draw(object);
}
addAggregator(aggregator) {
this.currentStage.addAggregator(aggregator);
}
batchDraw() {
Stages.getCurrentStage()
.getCurrentKonvaLayer()
.batchDraw();
}
addAction(action) {
Stages.getCurrentLayer().actionManager.push(action);
}
removeAction(action) {
Stages.getCurrentLayer().actionManager.remove(action);
}
}
export const drawerManager = new DrawerManager();