Angular2: mouse event handling (movement relative to current position)
问题 My user should be able to move (or rotate) an object by mouse in a canvas. When mouse events occur the screen coordinates are used to calculate the delta (direction and length) to the last event. Nothing special... mousedown (get the first coordinate) mousemove (get nth coordinate, calculate deltaXY, move object by deltaXY) mouseup (same as step 2 and stop the mousemove and mouseup event handling) After this chain of events it should be possible to repeat the same action. This outdated