浏览代码

update handle Event

/siyaoH-1.17-HandleEvent
siyao 3 年前
当前提交
cab28748
共有 14 个文件被更改,包括 36 次插入17 次删除
  1. 3
      com.unity.uiwidgets/Runtime/cupertino/slider.cs
  2. 3
      com.unity.uiwidgets/Runtime/cupertino/sliding_segmented_control.cs
  3. 3
      com.unity.uiwidgets/Runtime/cupertino/switch.cs
  4. 12
      com.unity.uiwidgets/Runtime/gestures/binding.cs
  5. 3
      com.unity.uiwidgets/Runtime/gestures/hit_test.cs
  6. 3
      com.unity.uiwidgets/Runtime/material/range_slider.cs
  7. 3
      com.unity.uiwidgets/Runtime/material/slider.cs
  8. 6
      com.unity.uiwidgets/Runtime/material/switch.cs
  9. 4
      com.unity.uiwidgets/Runtime/material/toggleable.cs
  10. 3
      com.unity.uiwidgets/Runtime/rendering/editable.cs
  11. 2
      com.unity.uiwidgets/Runtime/rendering/object.cs
  12. 3
      com.unity.uiwidgets/Runtime/rendering/paragraph.cs
  13. 3
      com.unity.uiwidgets/Runtime/rendering/proxy_box.cs
  14. 2
      com.unity.uiwidgets/Runtime/rendering/sliver.cs

3
com.unity.uiwidgets/Runtime/cupertino/slider.cs


return (position.dx - _thumbCenter).abs() < CupertinoThumbPainter.radius + SliderUtils._kPadding;
}
public override void handleEvent(PointerEvent e, HitTestEntry entry) {
public override void handleEvent(Func<PointerEvent> evts, HitTestEntry entry) {
var e = evts();
D.assert(debugHandleEvent(e, entry));
if (e is PointerDownEvent pointerDownEvent && isInteractive) {
_drag.addPointer(pointerDownEvent);

3
com.unity.uiwidgets/Runtime/cupertino/sliding_segmented_control.cs


}
}
public override void handleEvent(PointerEvent _event, HitTestEntry entry) {
public override void handleEvent(Func<PointerEvent> evts, HitTestEntry entry) {
var _event = evts();
entry = (BoxHitTestEntry) entry;
D.assert(debugHandleEvent(_event, entry));

3
com.unity.uiwidgets/Runtime/cupertino/switch.cs


return true;
}
public override void handleEvent(PointerEvent evt, HitTestEntry entry) {
public override void handleEvent(Func<PointerEvent> evts, HitTestEntry entry) {
var evt = evts();
D.assert(debugHandleEvent(evt, entry));
if (evt is PointerDownEvent && isInteractive) {
_state._drag.addPointer((PointerDownEvent) evt);

12
com.unity.uiwidgets/Runtime/gestures/binding.cs


using System;
using System.Collections.Generic;
using Unity.Profiling;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.rendering;
using UnityEngine.Profiling;
namespace Unity.UIWidgets.gestures {
public class GestureBinding : BindingBase, HitTestable, HitTestDispatcher, HitTestTarget {

dispatchEvent(evt, hitTestResult);
}
}
void _handlePointerScrollEvent(PointerEvent evt) {
pointerRouter.clearScrollRoute(evt.pointer);
if (!pointerRouter.acceptScroll()) {

foreach (HitTestEntry entry in hitTestResult.path) {
try {
entry.target.handleEvent(evt.transformed(entry.transform), entry);
entry.target.handleEvent(()=> evt.transformed(entry.transform), entry);
}
catch (Exception ex) {
D.logError("Error while dispatching a pointer event: ", ex);

static readonly ProfilerMarker s_sPreparePerfMarker = new ProfilerMarker("MySystem.XXXX");
public void handleEvent(PointerEvent evt, HitTestEntry entry) {
public void handleEvent(Func<PointerEvent> evts, HitTestEntry entry) {
var evt = evts();
pointerRouter.route(evt);
if (evt is PointerDownEvent) {
gestureArena.close(evt.pointer);

3
com.unity.uiwidgets/Runtime/gestures/hit_test.cs


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.external;

}
public interface HitTestTarget {
void handleEvent(PointerEvent evt, HitTestEntry entry);
void handleEvent(Func<PointerEvent> evt, HitTestEntry entry);
}
public class HitTestEntry {

3
com.unity.uiwidgets/Runtime/material/range_slider.cs


return true;
}
public override void handleEvent(PointerEvent evt, HitTestEntry entry) {
public override void handleEvent(Func<PointerEvent> evts, HitTestEntry entry) {
var evt = evts();
D.assert(debugHandleEvent(evt, entry));
if (evt is PointerDownEvent && isEnabled) {
_drag.addPointer((PointerDownEvent) evt);

3
com.unity.uiwidgets/Runtime/material/slider.cs


return true;
}
public override void handleEvent(PointerEvent evt, HitTestEntry entry) {
public override void handleEvent(Func<PointerEvent> evts, HitTestEntry entry) {
var evt = evts();
D.assert(debugHandleEvent(evt, entry));
if (evt is PointerDownEvent && isInteractive) {
_drag.addPointer((PointerDownEvent) evt);

6
com.unity.uiwidgets/Runtime/material/switch.cs


using System;
using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.foundation;

state._didFinishDragging();
}
public override void handleEvent(PointerEvent evt, HitTestEntry entry) {
public override void handleEvent(Func<PointerEvent> evts, HitTestEntry entry) {
var evt = evts();
base.handleEvent(evt, entry);
base.handleEvent(()=>evt, entry);
}
Color _cachedThumbColor;

4
com.unity.uiwidgets/Runtime/material/toggleable.cs


return true;
}
public override void handleEvent(PointerEvent pEvent, HitTestEntry entry) {
public override void handleEvent(Func<PointerEvent> evts, HitTestEntry entry) {
var pEvent = evts();
D.assert(debugHandleEvent(pEvent, entry));
if (pEvent is PointerDownEvent && isInteractive) {
_tap.addPointer((PointerDownEvent) pEvent);

3
com.unity.uiwidgets/Runtime/rendering/editable.cs


TapGestureRecognizer _tap;
LongPressGestureRecognizer _longPress;
public override void handleEvent(PointerEvent evt, HitTestEntry entry) {
public override void handleEvent(Func<PointerEvent> evts, HitTestEntry entry) {
var evt = evts();
if (ignorePointer) {
return;
}

2
com.unity.uiwidgets/Runtime/rendering/object.cs


public abstract Rect semanticBounds { get; }
public virtual void handleEvent(PointerEvent evt, HitTestEntry entry) {
public virtual void handleEvent(Func<PointerEvent> evt, HitTestEntry entry) {
}
public override string toStringShort() {

3
com.unity.uiwidgets/Runtime/rendering/paragraph.cs


public override void handleEvent(PointerEvent evt, HitTestEntry entry) {
public override void handleEvent(Func<PointerEvent> evts, HitTestEntry entry) {
var evt = evts();
D.assert(debugHandleEvent(evt, entry));
if (!(evt is PointerDownEvent)) {
return;

3
com.unity.uiwidgets/Runtime/rendering/proxy_box.cs


size = constraints.biggest;
}
public override void handleEvent(PointerEvent Event, HitTestEntry entry) {
public override void handleEvent(Func<PointerEvent> evts, HitTestEntry entry) {
var Event = evts();
D.assert(debugHandleEvent(Event, entry));
if (onPointerDown != null && Event is PointerDownEvent) {
onPointerDown((PointerDownEvent) Event);

2
com.unity.uiwidgets/Runtime/rendering/sliver.cs


});
}
public override void handleEvent(PointerEvent evt, HitTestEntry entry) { }
public override void handleEvent(Func<PointerEvent> evt, HitTestEntry entry) { }
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<SliverGeometry>("geometry", geometry));

正在加载...
取消
保存