fix: fix combo&node drag error

This commit is contained in:
openwayne 2021-03-21 20:39:03 +08:00 committed by Yanyan Wang
parent ed3b8d4be4
commit 3c4a262b49
3 changed files with 4 additions and 20 deletions

View File

@ -27,9 +27,9 @@ export default {
}, },
getEvents(): { [key in G6Event]?: string } { getEvents(): { [key in G6Event]?: string } {
return { return {
'node:panstart': 'onDragStart', 'node:dragstart': 'onDragStart',
'node:panmove': 'onDrag', 'node:drag': 'onDrag',
'node:panend': 'onDragEnd', 'node:dragend': 'onDragEnd',
'combo:dragenter': 'onDragEnter', 'combo:dragenter': 'onDragEnter',
'combo:dragleave': 'onDragLeave', 'combo:dragleave': 'onDragLeave',
'combo:drop': 'onDropCombo', 'combo:drop': 'onDropCombo',

View File

@ -75,22 +75,6 @@ export default class EventController extends AbstractEvent {
evt.currentTarget = graph; evt.currentTarget = graph;
//if (evt.type === 'touchstart') {
// //graph.emit('node:dragenter', evt);
// graph.emit('node:dragstart', evt);
//}
//if (evt.type === 'touchend') {
// //graph.emit('node:drop', evt);
// //graph.emit('canvas:drop', evt);
// graph.emit('node:dragend', evt);
// //graph.emit('node:dragleave', evt);
//}
//if (evt.type === 'touchmove') {
// graph.emit('node:drag', evt);
//}
if (target === canvas) { if (target === canvas) {
if (eventType === 'panmove') { if (eventType === 'panmove') {
this.handleTouchMove(evt, 'canvas'); this.handleTouchMove(evt, 'canvas');