fix: node event with wrong canvasX and canvasY problem, closes: #2027

This commit is contained in:
Yanyan-Wang 2020-09-03 00:18:00 +08:00 committed by Yanyan Wang
parent 0f08aac908
commit 4342f72d44
2 changed files with 6 additions and 0 deletions

View File

@ -10,6 +10,7 @@
- fix: tooltip behavior with shouldBegin problem, closes #2016;
- fix: the position of grid plugins when there is something on the top of the canvas, closes: #2012;
- fix: fisheye destroy and new problem, closes: #2018;
- fix: node event with wrong canvasX and canvasY problem, closes: #2027;
- feat: improve the performance on the combos;
- feat: hide shapes beside keyShape while zooming.

View File

@ -156,6 +156,11 @@ export default class EventController {
// 事件target是触发事件的Shape实例item是触发事件的item实例
evt.target = target;
evt.item = item;
if (evt.canvasX === evt.x && evt.canvasY === evt.y) {
const canvasPoint = graph.getCanvasByPoint(evt.x, evt.y);
evt.canvasX = canvasPoint.x;
evt.canvasY = canvasPoint.y;
}
// emit('click', evt);
graph.emit(eventType, evt);