浏览代码

Update.

/main
Yuncong Zhang 6 年前
当前提交
76d398a8
共有 2 个文件被更改,包括 13 次插入13 次删除
  1. 24
      Runtime/gestures/binding.cs
  2. 2
      Runtime/gestures/hit_test.cs

24
Runtime/gestures/binding.cs


this._handlePointerHoverEvent(evt);
}
HitTestResult result = null;
HitTestResult hitTestResult = null;
result = new HitTestResult();
this.hitTest(result, evt.position);
hitTestResult = new HitTestResult();
this.hitTest(hitTestResult, evt.position);
this._hitTests[evt.pointer] = result;
this._hitTests[evt.pointer] = hitTestResult;
Debug.LogFormat("{0}: {1}", evt, result);
Debug.LogFormat("{0}: {1}", evt, hitTestResult);
}
return true;

result = this._hitTests.getOrDefault(evt.pointer);
hitTestResult = this._hitTests.getOrDefault(evt.pointer);
result = this._hitTests.getOrDefault(evt.pointer);
hitTestResult = this._hitTests.getOrDefault(evt.pointer);
}
D.assert(() => {

return true;
});
if (result != null ||
if (hitTestResult != null ||
this.dispatchEvent(evt, result);
this.dispatchEvent(evt, hitTestResult);
}
}

result.add(new HitTestEntry(this));
}
public void dispatchEvent(PointerEvent evt, HitTestResult result) {
if (result == null) {
public void dispatchEvent(PointerEvent evt, HitTestResult hitTestResult) {
if (hitTestResult == null) {
D.assert(evt is PointerHoverEvent || evt is PointerAddedEvent || evt is PointerRemovedEvent);
try {
this.pointerRouter.route(evt);

return;
}
foreach (HitTestEntry entry in result.path) {
foreach (HitTestEntry entry in hitTestResult.path) {
try {
entry.target.handleEvent(evt, entry);
}

2
Runtime/gestures/hit_test.cs


}
public interface HitTestDispatcher {
void dispatchEvent(PointerEvent evt, HitTestResult result);
void dispatchEvent(PointerEvent evt, HitTestResult hitTestResult);
}
public interface HitTestTarget {

正在加载...
取消
保存