12345678910111213141516171819202122232425262728293031 |
- 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);
- }
- }
- export const drawerManager = new DrawerManager();
|