|
|
|
|
|
|
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); |
|
|
|
} |
|
|
|