浏览代码

fix conflict between drag & scroll

/main
xingwei.zhu 5 年前
当前提交
07957f52
共有 3 个文件被更改,包括 8 次插入1 次删除
  1. 2
      Runtime/editor/editor_window.cs
  2. 3
      Runtime/gestures/binding.cs
  3. 4
      Runtime/gestures/pointer_router.cs

2
Runtime/editor/editor_window.cs


-evt.delta.y * this._devicePixelRatio,
evt.mousePosition.x * this._devicePixelRatio,
evt.mousePosition.y * this._devicePixelRatio,
InputUtils.getMouseButtonKey(evt.button)
InputUtils.getScrollButtonKey()
);
}
else if (evt.type == EventType.DragUpdated) {

3
Runtime/gestures/binding.cs


void _handlePointerScrollEvent(PointerEvent evt) {
this.pointerRouter.clearScrollRoute(evt.pointer);
if (!this.pointerRouter.acceptScroll()) {
return;
}
HitTestResult result = new HitTestResult();
this.hitTest(result, evt.position);

4
Runtime/gestures/pointer_router.cs


this._routeMap.Remove(pointer);
}
}
public bool acceptScroll() {
return this._routeMap.Count == 0;
}
public void clearScrollRoute(int pointer) {
if (this._routeMap.ContainsKey(pointer)) {

正在加载...
取消
保存