canvas-editor-engine 2.3.75 → 2.3.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +3 -6
- package/dist/utils/painter.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -2671,25 +2671,20 @@ var Painter = function() {
|
|
2671
2671
|
view: new Date,
|
2672
2672
|
digital: Date.now()
|
2673
2673
|
};
|
2674
|
-
this.subscribeOnCanvas();
|
2675
2674
|
}
|
2676
|
-
Painter.prototype.subscribeOnCanvas = function() {
|
2675
|
+
Painter.prototype.subscribeOnCanvas = function(render) {
|
2677
2676
|
var _this = this;
|
2678
2677
|
this.canvasComponent.subscribe("mousedown", (function() {
|
2679
|
-
console.log("TIMER START!");
|
2680
2678
|
_this.focusTimer = setTimeout((function() {
|
2681
2679
|
_this.focusPainter();
|
2682
|
-
console.log("FOCUSED!");
|
2683
2680
|
}), 800);
|
2684
2681
|
}));
|
2685
2682
|
this.canvasComponent.subscribe("mouseup", (function() {
|
2686
2683
|
_this.blurPainter();
|
2687
2684
|
_this.focusTimer = null;
|
2688
|
-
console.log("BLUR!");
|
2689
2685
|
}));
|
2690
2686
|
this.canvasComponent.subscribe("mousemove", (function(event, cursorPosition) {
|
2691
2687
|
if (!_this.isFocused) return;
|
2692
|
-
console.log("MOVE!");
|
2693
2688
|
var x = cursorPosition.x, y = cursorPosition.y;
|
2694
2689
|
var size = _this.drawService.options.image.drawImageArgs.size;
|
2695
2690
|
var condition = size && size !== "initial";
|
@@ -2698,6 +2693,7 @@ var Painter = function() {
|
|
2698
2693
|
y: condition ? y - size.height / 2 : y
|
2699
2694
|
};
|
2700
2695
|
_this.changePainterPosition(position);
|
2696
|
+
render();
|
2701
2697
|
}));
|
2702
2698
|
};
|
2703
2699
|
Painter.prototype.focusPainter = function() {
|
@@ -2821,6 +2817,7 @@ var DrawAccumulatorService = function() {
|
|
2821
2817
|
});
|
2822
2818
|
this.drawLayersService.addToLayer(layerId, painter);
|
2823
2819
|
this.invokePainter(drawType, painter.drawService);
|
2820
|
+
painter.subscribeOnCanvas(this.update.bind(this));
|
2824
2821
|
return [ 2 ];
|
2825
2822
|
}));
|
2826
2823
|
}));
|
package/dist/utils/painter.d.ts
CHANGED
@@ -19,7 +19,7 @@ export default class Painter {
|
|
19
19
|
isSelected: boolean;
|
20
20
|
focusTimer: NodeJS.Timeout | null;
|
21
21
|
constructor(canvasComponent: CanvasComponent, drawLayersService: DrawLayersService, createModel: ICreatePainter);
|
22
|
-
|
22
|
+
subscribeOnCanvas(render: () => void): void;
|
23
23
|
focusPainter(): void;
|
24
24
|
blurPainter(): void;
|
25
25
|
selectPainter(): void;
|