Open RangerGuan opened 2 years ago
Well, I had to remove the previous time listener before every redraw. this.stage.getStage().removeEventListener('mousedown mouseup');
@RangerGuan Why you use native event? ng2-konva have angular events - use it (http://rafaelescala.com/ng2-konva/#event)
Since the last update, the mouseup
event on ko-stage
trigger 2 times :
<div #koContainer class="ko-container" [ngStyle]="{ cursor: planState.cursor }">
<ko-stage
*ngIf="configStage"
#stage
[config]="configStage"
(mousedown)="handStart()"
(mousemove)="handMove()"
(mouseup)="handEnd()"
(touchmove)="handMove()"
(touchstart)="handStart()"
(wheel)="wheelStart($event)"
>
<ko-layer #layer />
</ko-stage>
</div>
I confirm that the events are all called twice :
• Object { angularComponent: {…}, event: {…} }
• mousedown { target: canvas, buttons: 1, clientX: 1357, clientY: 269, layerX: 1324, layerY: 236 }