浏览代码

keep mouse_track behavior all the same as in flutter

/main
xingwei.zhu 6 年前
当前提交
edba9e11
共有 1 个文件被更改,包括 13 次插入13 次删除
  1. 26
      Runtime/gestures/mouse_tracking.cs

26
Runtime/gestures/mouse_tracking.cs


}
_TrackedAnnotation hitAnnotation = this._findAnnotation(hit);
//enter
if (!hitAnnotation.activeDevices.Contains(deviceId)) {
hitAnnotation.activeDevices.Add(deviceId);
if (hitAnnotation.annotation?.onEnter != null) {
hitAnnotation.annotation.onEnter(PointerEnterEvent.fromHoverEvent(lastEvent));
}
}
//hover
if (hitAnnotation.annotation?.onHover != null) {
hitAnnotation.annotation.onHover(PointerHoverEvent.fromHoverEvent(lastEvent));
}
//leave
foreach (_TrackedAnnotation trackedAnnotation in this._trackedAnnotations.Values) {
if (hitAnnotation == trackedAnnotation) {

trackedAnnotation.activeDevices.Remove(deviceId);
}
}
//enter
if (!hitAnnotation.activeDevices.Contains(deviceId)) {
hitAnnotation.activeDevices.Add(deviceId);
if (hitAnnotation.annotation?.onEnter != null) {
hitAnnotation.annotation.onEnter(PointerEnterEvent.fromHoverEvent(lastEvent));
}
}
//hover
if (hitAnnotation.annotation?.onHover != null) {
hitAnnotation.annotation.onHover(PointerHoverEvent.fromHoverEvent(lastEvent));
}
}
}
正在加载...
取消
保存