浏览代码

add local position

/main
siyao 4 年前
当前提交
239f2267
共有 43 个文件被更改,包括 1666 次插入352 次删除
  1. 4
      com.unity.uiwidgets/Runtime/cupertino/action_sheet.cs
  2. 4
      com.unity.uiwidgets/Runtime/cupertino/dialog.cs
  3. 1
      com.unity.uiwidgets/Runtime/foundation/diagnostics.cs
  4. 2
      com.unity.uiwidgets/Runtime/gestures/binding.cs
  5. 16
      com.unity.uiwidgets/Runtime/gestures/drag_details.cs
  6. 626
      com.unity.uiwidgets/Runtime/gestures/events.cs
  7. 47
      com.unity.uiwidgets/Runtime/gestures/hit_test.cs
  8. 44
      com.unity.uiwidgets/Runtime/gestures/long_press.cs
  9. 95
      com.unity.uiwidgets/Runtime/gestures/monodrag.cs
  10. 55
      com.unity.uiwidgets/Runtime/gestures/multitap.cs
  11. 79
      com.unity.uiwidgets/Runtime/gestures/pointer_router.cs
  12. 4
      com.unity.uiwidgets/Runtime/gestures/pointer_signal_resolver.cs
  13. 100
      com.unity.uiwidgets/Runtime/gestures/recognizer.cs
  14. 6
      com.unity.uiwidgets/Runtime/gestures/tap.cs
  15. 4
      com.unity.uiwidgets/Runtime/material/chip.cs
  16. 2
      com.unity.uiwidgets/Runtime/material/input_decorator.cs
  17. 2
      com.unity.uiwidgets/Runtime/material/list_tile.cs
  18. 78
      com.unity.uiwidgets/Runtime/rendering/box.cs
  19. 31
      com.unity.uiwidgets/Runtime/rendering/box.mixin.gen.cs
  20. 2
      com.unity.uiwidgets/Runtime/rendering/custom_layout.cs
  21. 2
      com.unity.uiwidgets/Runtime/rendering/custom_paint.cs
  22. 2
      com.unity.uiwidgets/Runtime/rendering/flex.cs
  23. 5
      com.unity.uiwidgets/Runtime/rendering/layer.cs
  24. 2
      com.unity.uiwidgets/Runtime/rendering/list_body.cs
  25. 2
      com.unity.uiwidgets/Runtime/rendering/list_wheel_viewport.cs
  26. 34
      com.unity.uiwidgets/Runtime/rendering/proxy_box.cs
  27. 2
      com.unity.uiwidgets/Runtime/rendering/proxy_box.mixin.gen.cs
  28. 2
      com.unity.uiwidgets/Runtime/rendering/rotated_box.cs
  29. 2
      com.unity.uiwidgets/Runtime/rendering/shifted_box.cs
  30. 115
      com.unity.uiwidgets/Runtime/rendering/sliver.cs
  31. 6
      com.unity.uiwidgets/Runtime/rendering/sliver_multi_box_adaptor.cs
  32. 11
      com.unity.uiwidgets/Runtime/rendering/sliver_padding.cs
  33. 4
      com.unity.uiwidgets/Runtime/rendering/sliver_persistent_header.cs
  34. 65
      com.unity.uiwidgets/Runtime/rendering/stack.cs
  35. 2
      com.unity.uiwidgets/Runtime/rendering/table.cs
  36. 2
      com.unity.uiwidgets/Runtime/rendering/view.cs
  37. 25
      com.unity.uiwidgets/Runtime/rendering/viewport.cs
  38. 2
      com.unity.uiwidgets/Runtime/rendering/wrap.cs
  39. 34
      com.unity.uiwidgets/Runtime/ui/Matrix4.cs
  40. 2
      com.unity.uiwidgets/Runtime/widgets/layout_builder.cs
  41. 2
      com.unity.uiwidgets/Runtime/widgets/nested_scroll_view.cs
  42. 491
      com.unity.uiwidgets/Runtime/widgets/overlay.cs
  43. 2
      com.unity.uiwidgets/Runtime/widgets/single_child_scroll_view.cs

4
com.unity.uiwidgets/Runtime/cupertino/action_sheet.cs


);
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
bool isHit = false;
MultiChildLayoutParentData contentSectionParentData =
this.contentSection.parentData as MultiChildLayoutParentData;

}
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return this.defaultHitTestChildren(result, position: position);
}
}

4
com.unity.uiwidgets/Runtime/cupertino/dialog.cs


);
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null
) {
bool isHit = false;
BoxParentData contentSectionParentData = this.contentSection.parentData as BoxParentData;

}
}
protected override bool hitTestChildren(HitTestResult result,
protected override bool hitTestChildren(BoxHitTestResult result,
Offset position = null
) {
return this.defaultHitTestChildren(result, position: position);

1
com.unity.uiwidgets/Runtime/foundation/diagnostics.cs


transition,
whitespace,
singleLine,
errorProperty,
}
public class TextTreeConfiguration {

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


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

16
com.unity.uiwidgets/Runtime/gestures/drag_details.cs


namespace Unity.UIWidgets.gestures {
public class DragDownDetails {
public DragDownDetails(
Offset globalPosition = null
Offset globalPosition = null,
Offset localPosition = null
this.localPosition = localPosition ?? this.globalPosition;
public readonly Offset localPosition;
public override string ToString() {
return this.GetType() + "(" + this.globalPosition + ")";

public delegate void GestureDragDownCallback(DragDownDetails details);
public class DragStartDetails {
public DragStartDetails(TimeSpan sourceTimeStamp, Offset globalPosition = null) {
public DragStartDetails(
TimeSpan sourceTimeStamp,
Offset globalPosition = null,
Offset localPosition = null
) {
this.localPosition = localPosition ?? this.globalPosition;
public readonly Offset localPosition;
public override string ToString() {
return this.GetType() + "(" + this.globalPosition + ")";

Offset delta = null,
float? primaryDelta = null,
Offset globalPosition = null,
Offset localPosition = null,
this.localPosition = localPosition ?? this.globalPosition;
this.isScroll = isScroll;
D.assert(primaryDelta == null
|| primaryDelta == this.delta.dx && this.delta.dy == 0.0

public readonly float? primaryDelta;
public readonly Offset globalPosition;
public readonly Offset localPosition;
public readonly bool isScroll;

626
com.unity.uiwidgets/Runtime/gestures/events.cs


using System;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;
using Object = UnityEngine.Object;
namespace Unity.UIWidgets.gestures {

PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset localPosition = null,
Offset localDelta = null,
int buttons = 0,
bool down = false,
bool obscured = false,

float orientation = 0.0f,
float tilt = 0.0f,
int platformData = 0,
bool synthesized = false
bool synthesized = false,
Matrix4 transform = null,
PointerEvent original = null
) {
this.timeStamp = timeStamp;
this.pointer = pointer;

this.localPosition = localPosition ?? this.position;
this.localDelta = delta ?? this.delta;
this.buttons = buttons;
this.down = down;
this.obscured = obscured;

this.tilt = tilt;
this.platformData = platformData;
this.synthesized = synthesized;
this.transform = transform;
this.original = original;
}
public readonly TimeSpan timeStamp;

public readonly Offset position;
public readonly Offset localPosition;
public readonly Offset localDelta;
public readonly int buttons;

public readonly bool synthesized;
public readonly Matrix4 transform;
public readonly PointerEvent original;
public abstract PointerEvent transformed(Matrix4 transform);
properties.add(new DiagnosticsProperty<Offset>("localPosition", this.localPosition));
level: DiagnosticLevel.debug));
properties.add(new DiagnosticsProperty<Offset>("localDelta", this.localDelta, defaultValue: Offset.zero,
level: DiagnosticLevel.debug));
properties.add(new DiagnosticsProperty<TimeSpan>("timeStamp", this.timeStamp, defaultValue: TimeSpan.Zero,
level: DiagnosticLevel.debug));

properties.add(new FlagProperty("synthesized", value: this.synthesized, ifTrue: "synthesized",
level: DiagnosticLevel.debug));
}
public static Offset transformPosition(Matrix4 transform, Offset position) {
if (transform == null) {
return position;
}
Vector3 position3 = new Vector3(position.dx, position.dy, 0.0f);
Vector3 transformed3 = transform.perspectiveTransform(position3);
return new Offset(transformed3.x, transformed3.y);
}
public static Offset transformDeltaViaPositions(
Offset untransformedEndPosition,
Offset untransformedDelta,
Matrix4 transform,
Offset transformedEndPosition = null
) {
if (transform == null) {
return untransformedDelta;
}
transformedEndPosition ??= transformPosition(transform, untransformedEndPosition);
Offset transformedStartPosition =
transformPosition(transform, untransformedEndPosition - untransformedDelta);
return transformedEndPosition - transformedStartPosition;
}
public static Matrix4 removePerspectiveTransform(Matrix4 transform) {
Vector4 vector = new Vector4(0, 0, 1, 0);
var result = transform.clone();
result.setColumn(2, vector);
result.setRow(2, vector);
return result;
}
}
public class PointerAddedEvent : PointerEvent {

int device = 0,
Offset position = null,
Offset localPosition = null,
bool obscured = false,
float pressure = 0.0f,
float pressureMin = 1.0f,

float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f
float tilt = 0.0f,
Matrix4 transform = null,
PointerAddedEvent original = null
localPosition: localPosition,
obscured: obscured,
pressure: pressure,
pressureMin: pressureMin,

radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt
tilt: tilt,
transform: transform,
original: original
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerAddedEvent(
timeStamp: this.timeStamp,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
obscured: this.obscured,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distance: this.distance,
distanceMax: this.distanceMax,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
transform: this.transform,
original: this.original as PointerAddedEvent ?? this
);
}
}
public class PointerRemovedEvent : PointerEvent {

int device = 0,
Offset position = null,
Offset localPosition = null,
bool obscured = false,
float pressure = 0.0f,
float pressureMin = 1.0f,

float radiusMax = 0.0f
float radiusMax = 0.0f,
Matrix4 transform = null,
PointerRemovedEvent original = null
position: position,
localPosition: localPosition,
device: device,
obscured: obscured,
pressure: pressure,

radiusMin: radiusMin,
radiusMax: radiusMax
radiusMax: radiusMax,
transform: transform,
original: original
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerRemovedEvent(
timeStamp: this.timeStamp,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
obscured: this.obscured,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distanceMax: this.distanceMax,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
transform: transform,
original: this.original as PointerRemovedEvent ?? this
);
}
}
public class PointerHoverEvent : PointerEvent {

int device = 0,
Offset position = null,
Offset localPosition = null,
Offset localDelta = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,

float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f,
bool synthesized = false) : base(
bool synthesized = false,
Matrix4 transform = null,
PointerHoverEvent original = null) : base(
localPosition: localDelta,
localDelta: localDelta,
buttons: buttons,
obscured: obscured,
pressure: pressure,

radiusMax: radiusMax,
orientation: orientation,
tilt: tilt,
synthesized: synthesized) {
synthesized: synthesized,
transform: transform,
original: original) {
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
Offset transformedPosition = PointerEvent.transformPosition(transform, this.position);
return new PointerHoverEvent(
timeStamp: this.timeStamp,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: transformedPosition,
delta: this.delta,
localDelta: PointerEvent.transformDeltaViaPositions(
transform: transform,
untransformedDelta: this.delta,
untransformedEndPosition: this.position,
transformedEndPosition: transformedPosition
),
buttons: this.buttons,
obscured: this.obscured,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distance: this.distance,
distanceMax: this.distanceMax,
size: this.size,
radiusMajor: this.radiusMajor,
radiusMinor: this.radiusMinor,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
synthesized: this.synthesized,
transform: transform,
original: this.original as PointerHoverEvent ?? this);
}
}

PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset localPosition = null,
Offset localDelta = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,

float orientation = 0.0f,
float tilt = 0.0f,
bool synthesized = false,
bool down = false) : base(
bool down = false,
Matrix4 transform = null,
PointerEnterEvent original = null) : base(
localPosition: localPosition,
localDelta: localDelta,
buttons: buttons,
down: down,
obscured: obscured,

radiusMax: radiusMax,
orientation: orientation,
tilt: tilt,
synthesized: synthesized) {
synthesized: synthesized,
transform: transform,
original: original) {
}
public static PointerEnterEvent fromHoverEvent(PointerHoverEvent e) {

kind: hover?.kind ?? PointerDeviceKind.touch,
device: hover?.device ?? 0,
position: hover?.position,
localPosition: hover?.localPosition,
localDelta: hover?.localDelta,
buttons: hover?.buttons ?? 0,
down: hover?.down ?? false,
obscured: hover?.obscured ?? false,

radiusMax: hover?.radiusMax ?? 0.0f,
orientation: hover?.orientation ?? 0.0f,
tilt: hover?.tilt ?? 0.0f,
synthesized: hover?.synthesized ?? false
synthesized: hover?.synthesized ?? false,
transform: hover?.transform,
original: hover?.original as PointerEnterEvent
);
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
Offset transformedPosition = PointerEvent.transformPosition(transform, this.position);
return new PointerEnterEvent(
timeStamp: this.timeStamp,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: transformedPosition,
delta: this.delta,
localDelta: PointerEvent.transformDeltaViaPositions(
transform: transform,
untransformedDelta: this.delta,
untransformedEndPosition: this.position,
transformedEndPosition: transformedPosition
),
buttons: this.buttons,
obscured: this.obscured,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distance: this.distance,
distanceMax: this.distanceMax,
size: this.size,
radiusMajor: this.radiusMajor,
radiusMinor: this.radiusMinor,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
down: this.down,
synthesized: this.synthesized,
transform: transform,
original: this.original as PointerEnterEvent ?? this
);
}
}

PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset localPosition = null,
Offset localDelta = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,

float orientation = 0.0f,
float tilt = 0.0f,
bool synthesized = false,
bool down = false) : base(
bool down = false,
Matrix4 transform = null,
PointerExitEvent original = null) : base(
localPosition: localPosition,
localDelta: localDelta,
buttons: buttons,
down: down,
obscured: obscured,

radiusMax: radiusMax,
orientation: orientation,
tilt: tilt,
synthesized: synthesized) {
synthesized: synthesized,
transform: transform,
original: original) {
public static PointerExitEvent fromHoverEvent(PointerHoverEvent e) {
return fromMouseEvent(e);
}

kind: hover?.kind ?? PointerDeviceKind.touch,
device: hover?.device ?? 0,
position: hover?.position,
localPosition: hover?.localPosition,
localDelta: hover?.localDelta,
buttons: hover?.buttons ?? 0,
down: hover?.down ?? false,
obscured: hover?.obscured ?? false,

radiusMax: hover?.radiusMax ?? 0.0f,
orientation: hover?.orientation ?? 0.0f,
tilt: hover?.tilt ?? 0.0f,
synthesized: hover?.synthesized ?? false
synthesized: hover?.synthesized ?? false,
transform: hover?.transform,
original: hover?.original as PointerExitEvent
);
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
Offset transformedPosition = PointerEvent.transformPosition(transform, this.position);
return new PointerExitEvent(
timeStamp: this.timeStamp,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: transformedPosition,
delta: this.delta,
localDelta: PointerEvent.transformDeltaViaPositions(
transform: transform,
untransformedDelta: this.delta,
untransformedEndPosition: this.position,
transformedEndPosition: transformedPosition
),
buttons: this.buttons,
obscured: this.obscured,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distance: this.distance,
distanceMax: this.distanceMax,
size: this.size,
radiusMajor: this.radiusMajor,
radiusMinor: this.radiusMinor,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
down: this.down,
synthesized: this.synthesized,
transform: transform,
original: this.original as PointerExitEvent ?? this
);
}
}

PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset localPosition = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,

float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f
float tilt = 0.0f,
Matrix4 transform = null,
PointerDownEvent original = null
) : base(
timeStamp: timeStamp,
pointer: pointer,

localPosition: localPosition,
buttons: buttons,
down: true,
obscured: obscured,

radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt) {
tilt: tilt,
transform: transform,
original: original) {
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerDownEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
buttons: this.buttons,
obscured: this.obscured,
pressure: this.pressure,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distanceMax: this.distanceMax,
size: this.size,
radiusMajor: this.radiusMajor,
radiusMinor: this.radiusMinor,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
transform: transform,
original: this.original as PointerDownEvent ?? this
);
}
}

PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset localPosition = null,
Offset localDelta = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,

float orientation = 0.0f,
float tilt = 0.0f,
int platformdData = 0,
bool synthesized = false
bool synthesized = false,
Matrix4 transform = null,
PointerMoveEvent original = null
) : base(
timeStamp: timeStamp,
pointer: pointer,

localPosition: localPosition,
localDelta: localDelta,
buttons: buttons,
down: true,
obscured: obscured,

orientation: orientation,
tilt: tilt,
platformData: platformdData,
synthesized: synthesized) {
synthesized: synthesized,
transform: transform,
original: original) {
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
Offset transformedPosition = PointerEvent.transformPosition(transform, this.position);
return new PointerMoveEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: transformedPosition,
delta: this.delta,
localDelta: PointerEvent.transformDeltaViaPositions(
transform: transform,
untransformedDelta: this.delta,
untransformedEndPosition: this.position,
transformedEndPosition: transformedPosition
),
buttons: this.buttons,
obscured: this.obscured,
pressure: this.pressure,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distanceMax: this.distanceMax,
size: this.size,
radiusMajor: this.radiusMajor,
radiusMinor: this.radiusMinor,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
// platformData: platformData,
synthesized: this.synthesized,
transform: transform,
original: this.original as PointerMoveEvent ?? this
);
}
}

PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset localPosition = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,

float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f
float tilt = 0.0f,
Matrix4 transform = null,
PointerUpEvent original = null
) : base(
timeStamp: timeStamp,
pointer: pointer,

localPosition: localPosition,
buttons: buttons,
down: false,
obscured: obscured,

radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt) {
tilt: tilt,
transform: transform,
original: original) {
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerUpEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
buttons: this.buttons,
obscured: this.obscured,
pressure: this.pressure,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distance: this.distance,
distanceMax: this.distanceMax,
size: this.size,
radiusMajor: this.radiusMajor,
radiusMinor: this.radiusMinor,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
transform: transform,
original: this.original as PointerUpEvent ?? this
);
public class PointerSignalEvent : PointerEvent {
public abstract class PointerSignalEvent : PointerEvent {
Offset position = null
Offset position = null,
Offset localPosition = null,
Matrix4 transform = null,
PointerSignalEvent original = null
position: position
position: position,
localPosition: localPosition,
transform: transform,
original: original
) {
}
}

PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null,
Offset scrollDelta = null)
Offset localPosition = null,
Offset scrollDelta = null,
Matrix4 transform = null,
PointerScrollEvent original = null)
position: position) {
position: position,
localPosition: localPosition,
transform: transform,
original: original) {
D.assert(position != null);
D.assert(scrollDelta != null);
this.scrollDelta = scrollDelta;

public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerScrollEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
scrollDelta: this.scrollDelta,
transform: transform,
original: this.original as PointerScrollEvent ?? this
);
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<Offset>("scrollDelta", this.scrollDelta));

PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset localPosition = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,

float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f
float tilt = 0.0f,
Matrix4 transform = null,
PointerCancelEvent original = null
) : base(
timeStamp: timeStamp,
pointer: pointer,

localPosition: localPosition,
buttons: buttons,
down: false,
obscured: obscured,

radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt) {
tilt: tilt,
transform: transform,
original: original) {
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerCancelEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
buttons: this.buttons,
obscured: this.obscured,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distance: this.distance,
distanceMax: this.distanceMax,
size: this.size,
radiusMajor: this.radiusMajor,
radiusMinor: this.radiusMinor,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
transform: transform,
original: this.original as PointerCancelEvent ?? this
);
}
}

int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null
Offset position = null,
Offset localPosition = null,
Matrix4 transform = null,
PointerDragFromEditorEnterEvent original = null
position: position
position: position,
localPosition: localPosition,
transform: transform,
original: original
) {
}

pointer: evt.pointer,
kind: evt.kind,
device: evt.device,
position: evt.position
position: evt.position,
localPosition: evt.localPosition,
transform: evt.transform,
original: evt.original as PointerDragFromEditorEnterEvent
);
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerDragFromEditorEnterEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
transform: transform,
original: this.original as PointerDragFromEditorEnterEvent ?? this
);
}
}

int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null
Offset position = null,
Offset localPosition = null,
Matrix4 transform = null,
PointerDragFromEditorExitEvent original = null
position: position
position: position,
localPosition: localPosition,
transform: transform,
original: original
) {
}

pointer: evt.pointer,
kind: evt.kind,
device: evt.device,
position: evt.position
position: evt.position,
localPosition: evt.localPosition,
transform: evt.transform,
original: evt.original as PointerDragFromEditorExitEvent
);
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerDragFromEditorExitEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
transform: transform,
original: this.original as PointerDragFromEditorExitEvent ?? this
);
}
}

int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null
Offset position = null,
Offset localPosition = null,
Matrix4 transform = null,
PointerDragFromEditorHoverEvent original = null
position: position
position: position,
localPosition: localPosition,
transform: transform,
original: original
) {
}

pointer: evt.pointer,
kind: evt.kind,
device: evt.device,
position: evt.position
position: evt.position,
localPosition: evt.localPosition,
transform: evt.transform,
original: evt.original as PointerDragFromEditorHoverEvent
);
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerDragFromEditorHoverEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
transform: this.transform,
original: this.original as PointerDragFromEditorHoverEvent ?? this
);
}
}

PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null,
Object[] objectReferences = null
Offset localPosition = null,
Object[] objectReferences = null,
Matrix4 transform = null,
PointerDragFromEditorReleaseEvent original = null
position: position
position: position,
localPosition: localPosition,
transform: transform,
original: original
) {
this.objectReferences = objectReferences;
}

kind: evt.kind,
device: evt.device,
position: evt.position,
objectReferences: objectReferences
localPosition: evt.localPosition,
objectReferences: objectReferences,
transform: evt.transform,
original: evt.original as PointerDragFromEditorReleaseEvent
);
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerDragFromEditorReleaseEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
objectReferences: this.objectReferences,
transform: this.transform,
original: this.original as PointerDragFromEditorReleaseEvent ?? this
);
}
}

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


using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.rendering;
using UnityEngine;
namespace Unity.UIWidgets.gestures {
public interface HitTestable {

public override string ToString() {
return this._target.ToString();
}
public Matrix4 transform {
get { return this._transform; }
}
internal Matrix4 _transform;
public HitTestResult(List<HitTestEntry> path = null) {
this._path = path ?? new List<HitTestEntry>();
public HitTestResult() {
this._path = new List<HitTestEntry>();
this._transforms = new LinkedList<Matrix4>();
}
public HitTestResult(HitTestResult result) {
this._path = result._path;
this._transforms = result._transforms;
}
public IList<HitTestEntry> path {

readonly List<HitTestEntry> _path;
readonly LinkedList<Matrix4> _transforms;
D.assert(entry.transform == null);
entry._transform = this._transforms.isEmpty() ? null : this._transforms.Last();
}
protected void pushTransform(Matrix4 transform) {
D.assert(transform != null);
D.assert(
this._debugVectorMoreOrLessEquals(transform.getRow(2), new Vector4(0, 0, 1, 0)) &&
this._debugVectorMoreOrLessEquals(transform.getColumn(2), new Vector4(0, 0, 1, 0))
);
this._transforms.AddLast(this._transforms.isEmpty()
? transform
: (transform * this._transforms.Last() as Matrix4));
}
protected void popTransform() {
D.assert(this._transforms.isNotEmpty);
this._transforms.RemoveLast();
}
bool _debugVectorMoreOrLessEquals(Vector4 a, Vector4 b,
double epsilon = SliverGeometry.precisionErrorTolerance) {
bool result = true;
D.assert(() => {
Vector4 difference = a - b;
return difference.SqrMagnitude() < epsilon;
});
return result;
}
public override string ToString() {

44
com.unity.uiwidgets/Runtime/gestures/long_press.cs


public class LongPressStartDetails {
public LongPressStartDetails(
Offset globalPosition = null
Offset globalPosition = null,
Offset localPosition = null
this.localPosition = localPosition ?? this.globalPosition;
public readonly Offset localPosition;
Offset offsetFromOrigin = null
Offset localPosition = null,
Offset offsetFromOrigin = null,
Offset localOffsetFromOrigin = null
this.localPosition = localPosition ?? this.globalPosition;
this.localOffsetFromOrigin = localOffsetFromOrigin ?? this.offsetFromOrigin;
public readonly Offset localPosition;
public readonly Offset localOffsetFromOrigin;
Offset globalPosition = null
Offset globalPosition = null,
Offset localPosition = null
this.localPosition = localPosition ?? this.globalPosition;
this.velocity = Velocity.zero;
public readonly Offset localPosition;
public readonly Velocity velocity;
TimeSpan? duration = null,
deadline: Constants.kLongPressTimeout,
deadline: duration ?? Constants.kLongPressTimeout,
postAcceptSlopTolerance: postAcceptSlopTolerance,
kind: kind,
debugOwner: debugOwner) { }

Offset _longPressOrigin;
OffsetPair _longPressOrigin;
int _initialButtons;
public GestureLongPressCallback onLongPress;

public GestureLongPressEndCallback onLongPressEnd;
VelocityTracker _velocityTracker;
protected override void didExceedDeadline() {
this.resolve(GestureDisposition.accepted);
this._longPressAccepted = true;

if (this.onLongPressStart != null) {
this.invokeCallback<object>("onLongPressStart",
() => {
this.onLongPressStart(new LongPressStartDetails(globalPosition: this._longPressOrigin));
this.onLongPressStart(new LongPressStartDetails(
globalPosition: this._longPressOrigin.global,
localPosition:this._longPressOrigin.local
));
return null;
});
}

if (this.onLongPressEnd != null) {
this.invokeCallback<object>("onLongPressEnd", () => {
this.onLongPressEnd(new LongPressEndDetails(globalPosition: evt.position));
this.onLongPressEnd(new LongPressEndDetails(
globalPosition: evt.position,
localPosition: evt.localPosition));
return null;
});
}

}
else if (evt is PointerDownEvent || evt is PointerCancelEvent) {
this._longPressAccepted = false;
this._longPressOrigin = evt.position;
this._longPressOrigin = OffsetPair.fromEventPosition(evt);
offsetFromOrigin: evt.position - this._longPressOrigin
localPosition: evt.localPosition,
offsetFromOrigin: evt.position - this._longPressOrigin.global,
localOffsetFromOrigin: evt.localPosition - this._longPressOrigin.local
));
return null;
});

95
com.unity.uiwidgets/Runtime/gestures/monodrag.cs


public float? maxFlingVelocity;
_DragState _state = _DragState.ready;
Offset _initialPosition;
protected Offset _pendingDragOffset;
OffsetPair _initialPosition;
protected OffsetPair _pendingDragOffset;
Matrix4 _lastTransform;
protected float _globalDistanceMoved;
protected abstract bool _hasSufficientPendingDragDeltaToAccept { get; }
protected abstract bool _hasSufficientGlobalDistanceToAccept { get; }
readonly Dictionary<int, VelocityTracker> _velocityTrackers = new Dictionary<int, VelocityTracker>();

this._state = _DragState.possible;
this._initialPosition = evt.position;
this._initialPosition = new OffsetPair(global: evt.position, local: evt.localPosition);
globalPosition: this._initialPosition
globalPosition: this._initialPosition.global,
localPosition: this._initialPosition.local
));
return null;
});

public override void addAllowedPointer(PointerDownEvent evt) {
this.startTrackingPointer(evt.pointer);
this.startTrackingPointer(evt.pointer, evt.transform);
this._initialPosition = evt.position;
this._pendingDragOffset = Offset.zero;
this._initialPosition = new OffsetPair(global: evt.position, local: evt.localPosition);
this._pendingDragOffset = OffsetPair.zero;
this._globalDistanceMoved = 0f;
this._lastTransform = evt.transform;
this.onDown(new DragDownDetails(globalPosition: this._initialPosition));
this.onDown(new DragDownDetails(
globalPosition: this._initialPosition.global,
localPosition: this._initialPosition.local));
return null;
});
}

delta: this._getDeltaForDetails(delta),
primaryDelta: this._getPrimaryValueFromOffset(delta),
globalPosition: evt.position,
localPosition: evt.localPosition,
isScroll: true
));
return null;

&& (evt is PointerDownEvent || evt is PointerMoveEvent)) {
var tracker = this._velocityTrackers[evt.pointer];
D.assert(tracker != null);
tracker.addPosition(evt.timeStamp, evt.position);
tracker.addPosition(evt.timeStamp, evt.localPosition);
Offset delta = evt.delta;
delta: this._getDeltaForDetails(delta),
primaryDelta: this._getPrimaryValueFromOffset(delta),
globalPosition: evt.position
delta: this._getDeltaForDetails(evt.localDelta),
primaryDelta: this._getPrimaryValueFromOffset(evt.localDelta),
globalPosition: evt.position,
localPosition: evt.localPosition
));
return null;
});

this._pendingDragOffset += delta;
this._pendingDragOffset += new OffsetPair(local: evt.localDelta, global: evt.delta);
if (this._hasSufficientPendingDragDeltaToAccept) {
this._lastTransform = evt.transform;
Offset movedLocally = this._getDeltaForDetails(evt.localDelta);
Matrix4 localToGlobalTransform = evt.transform == null ? null : Matrix4.tryInvert(evt.transform);
this._globalDistanceMoved += PointerEvent.transformDeltaViaPositions(
transform: localToGlobalTransform,
untransformedDelta: movedLocally,
untransformedEndPosition: evt.localPosition
).distance * (this._getPrimaryValueFromOffset(movedLocally) ?? 1).sign();
if (this._hasSufficientGlobalDistanceToAccept) {
this.resolve(GestureDisposition.accepted);
}
}

public override void acceptGesture(int pointer) {
if (this._state != _DragState.accepted) {
this._state = _DragState.accepted;
Offset delta = this._pendingDragOffset;
OffsetPair delta = this._pendingDragOffset;
Matrix4 transform = this._lastTransform;
Offset updateDelta = null;
Offset localUpdateDelta = null;
updateDelta = Offset.zero;
localUpdateDelta = Offset.zero;
updateDelta = this._getDeltaForDetails(delta);
localUpdateDelta = this._getDeltaForDetails(delta.local);
D.assert(updateDelta != null);
D.assert(localUpdateDelta != null);
this._pendingDragOffset = Offset.zero;
this._pendingDragOffset = OffsetPair.zero;
this._lastTransform = null;
globalPosition: this._initialPosition
globalPosition: this._initialPosition.global,
localPosition: this._initialPosition.local
if (updateDelta != Offset.zero && this.onUpdate != null) {
if (localUpdateDelta != Offset.zero && this.onUpdate != null) {
Matrix4 localToGlobal = transform != null ? Matrix4.tryInvert(transform) : null;
Offset correctedLocalPosition = this._initialPosition.local + localUpdateDelta;
Offset globalUpdateDelta = PointerEvent.transformDeltaViaPositions(
untransformedEndPosition: correctedLocalPosition,
untransformedDelta: localUpdateDelta,
transform: localToGlobal
);
OffsetPair updateDelta = new OffsetPair(local: localUpdateDelta, global: globalUpdateDelta);
OffsetPair correctedPosition = this._initialPosition + updateDelta; // Only adds delta for down behaviour
delta: updateDelta,
primaryDelta: this._getPrimaryValueFromOffset(updateDelta),
globalPosition: this._initialPosition + updateDelta
delta: localUpdateDelta,
primaryDelta: this._getPrimaryValueFromOffset(localUpdateDelta),
globalPosition: this._initialPosition.global,
localPosition: this._initialPosition.local
));
return null;
});

return Mathf.Abs(estimate.pixelsPerSecond.dy) > minVelocity && Mathf.Abs(estimate.offset.dy) > minDistance;
}
protected override bool _hasSufficientPendingDragDeltaToAccept {
get { return Mathf.Abs(this._pendingDragOffset.dy) > Constants.kTouchSlop; }
protected override bool _hasSufficientGlobalDistanceToAccept {
get { return Mathf.Abs(this._globalDistanceMoved) > Constants.kTouchSlop; }
}
protected override Offset _getDeltaForDetails(Offset delta) {

return Mathf.Abs(estimate.pixelsPerSecond.dx) > minVelocity && Mathf.Abs(estimate.offset.dx) > minDistance;
}
protected override bool _hasSufficientPendingDragDeltaToAccept {
get { return Mathf.Abs(this._pendingDragOffset.dx) > Constants.kTouchSlop; }
protected override bool _hasSufficientGlobalDistanceToAccept {
get { return Mathf.Abs(this._globalDistanceMoved) > Constants.kTouchSlop; }
}
protected override Offset _getDeltaForDetails(Offset delta) {

&& estimate.offset.distanceSquared > minDistance * minDistance;
}
protected override bool _hasSufficientPendingDragDeltaToAccept {
get { return this._pendingDragOffset.distance > Constants.kPanSlop; }
protected override bool _hasSufficientGlobalDistanceToAccept {
get { return Math.Abs(this._globalDistanceMoved) > Constants.kPanSlop; }
}
protected override Offset _getDeltaForDetails(Offset delta) {

55
com.unity.uiwidgets/Runtime/gestures/multitap.cs


GestureArenaEntry entry = null
) {
this.pointer = evt.pointer;
this._initialPosition = evt.position;
this._initialGlobalPosition = evt.position;
this._doubleTapMinTimeCountdown = new _CountdownZoned(duration: doubleTapMinTime);
this.entry = entry;
}

internal readonly Offset _initialPosition;
internal readonly Offset _initialGlobalPosition;
public void startTrackingPointer(PointerRoute route) {
public void startTrackingPointer(PointerRoute route, Matrix4 transfor) {
GestureBinding.instance.pointerRouter.addRoute(this.pointer, route);
GestureBinding.instance.pointerRouter.addRoute(this.pointer, route, transfor);
}
}

}
}
public bool isWithinTolerance(PointerEvent evt, float tolerance) {
Offset offset = evt.position - this._initialPosition;
public bool isWithinGlobalTolerance(PointerEvent evt, float tolerance) {
Offset offset = evt.position - this._initialGlobalPosition;
return offset.distance <= tolerance;
}

public class DoubleTapGestureRecognizer : GestureRecognizer {
public DoubleTapGestureRecognizer(object debugOwner = null, PointerDeviceKind? kind = null)
: base(debugOwner: debugOwner, kind: kind) { }
: base(debugOwner: debugOwner, kind: kind) {
}
public GestureDoubleTapCallback onDoubleTap;

public override void addAllowedPointer(PointerDownEvent evt) {
if (this._firstTap != null &&
!this._firstTap.isWithinTolerance(evt, Constants.kDoubleTapSlop)) {
!this._firstTap.isWithinGlobalTolerance(evt, Constants.kDoubleTapSlop)) {
return;
}

doubleTapMinTime: Constants.kDoubleTapMinTime
);
this._trackers[evt.pointer] = tracker;
tracker.startTrackingPointer(this._handleEvent);
tracker.startTrackingPointer(this._handleEvent, evt.transform);
}
void _handleEvent(PointerEvent evt) {

}
}
else if (evt is PointerMoveEvent) {
if (!tracker.isWithinTolerance(evt, Constants.kDoubleTapTouchSlop)) {
if (!tracker.isWithinGlobalTolerance(evt, Constants.kDoubleTapTouchSlop)) {
this._reject(tracker);
}
}

}
public override void acceptGesture(int pointer) { }
public override void acceptGesture(int pointer) {
}
public override void rejectGesture(int pointer) {
_TapTracker tracker;

}
void _registerSecondTap(_TapTracker tracker) {
var initialPosition = tracker._initialPosition;
var initialPosition = tracker._initialGlobalPosition;
this._firstTap.entry.resolve(GestureDisposition.accepted);
tracker.entry.resolve(GestureDisposition.accepted);
this._freezeTracker(tracker);

doubleTapMinTime: Constants.kDoubleTapMinTime
) {
this.gestureRecognizer = gestureRecognizer;
this._lastPosition = evt.position;
this.startTrackingPointer(this.handleEvent);
this._lastPosition = OffsetPair.fromEventPosition(evt);
this.startTrackingPointer(this.handleEvent, evt.transform);
if (longTapDelay > TimeSpan.Zero) {
this._timer = Window.instance.run(longTapDelay, () => {
this._timer = null;

bool _wonArena = false;
Timer _timer;
Offset _lastPosition;
Offset _finalPosition;
OffsetPair _lastPosition;
OffsetPair _finalPosition;
if (!this.isWithinTolerance(evt, Constants.kTouchSlop)) {
if (!this.isWithinGlobalTolerance(evt, Constants.kTouchSlop)) {
this._lastPosition = evt.position;
this._lastPosition = OffsetPair.fromEventPosition(evt);
}
}
else if (evt is PointerCancelEvent) {

this.stopTrackingPointer(this.handleEvent);
this._finalPosition = evt.position;
this._finalPosition = OffsetPair.fromEventPosition(evt);
this._check();
}
}

);
if (this.onTapDown != null) {
this.invokeCallback<object>("onTapDown", () => {
this.onTapDown(evt.pointer, new TapDownDetails(globalPosition: evt.position));
this.onTapDown(evt.pointer, new TapDownDetails(
globalPosition: evt.position,
localPosition: evt.localPosition,
kind: evt.kind));
return null;
});
}

}
}
public void _dispatchTap(int pointer, Offset globalPosition) {
public void _dispatchTap(int pointer, OffsetPair position) {
this.onTapUp(pointer, new TapUpDetails(globalPosition: globalPosition));
this.onTapUp(pointer, new TapUpDetails(globalPosition: position.global, localPosition: position.local));
return null;
});
}

}
}
public void _dispatchLongTap(int pointer, Offset lastPosition) {
public void _dispatchLongTap(int pointer, OffsetPair lastPosition) {
this.onLongTapDown(pointer, new TapDownDetails(globalPosition: lastPosition));
this.onLongTapDown(pointer, new TapDownDetails(
globalPosition: lastPosition.global,
localPosition: lastPosition.local));
return null;
});
}

79
com.unity.uiwidgets/Runtime/gestures/pointer_router.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;
namespace Unity.UIWidgets.gestures {

readonly Dictionary<int, HashSet<PointerRoute>> _routeMap = new Dictionary<int, HashSet<PointerRoute>>();
readonly Dictionary<int, Dictionary<PointerRoute, Matrix4>> _routeMap = new Dictionary<int, Dictionary<PointerRoute, Matrix4>>();
readonly HashSet<PointerRoute> _globalRoutes = new HashSet<PointerRoute>();
readonly Dictionary<PointerRoute, Matrix4> _globalRoutes = new Dictionary<PointerRoute, Matrix4>();
public void addRoute(int pointer, PointerRoute route) {
var routes = this._routeMap.putIfAbsent(pointer, () => new HashSet<PointerRoute>());
D.assert(!routes.Contains(route));
routes.Add(route);
public void addRoute(int pointer, PointerRoute route, Matrix4 transform = null) {
var routes = this._routeMap.putIfAbsent(
pointer,
() => new Dictionary<PointerRoute, Matrix4>()
);
D.assert(!routes.ContainsKey(route));
routes[route] = transform;
public void removeRoute(int pointer, PointerRoute route) {
D.assert(this._routeMap.ContainsKey(pointer));
var routes = this._routeMap[pointer];

}
}
public void addGlobalRoute(PointerRoute route, Matrix4 transform = null) {
D.assert(!this._globalRoutes.ContainsKey(route));
this._globalRoutes[route] = transform;
}
public void removeGlobalRoute(PointerRoute route) {
D.assert(this._globalRoutes.ContainsKey(route));
this._globalRoutes.Remove(route);
}
public bool acceptScroll() {
return this._routeMap.Count == 0;
}

}
}
public void addGlobalRoute(PointerRoute route) {
D.assert(!this._globalRoutes.Contains(route));
this._globalRoutes.Add(route);
}
public void removeGlobalRoute(PointerRoute route) {
D.assert(this._globalRoutes.Contains(route));
this._globalRoutes.Remove(route);
}
void _dispatch(PointerEvent evt, PointerRoute route) {
void _dispatch(PointerEvent evt, PointerRoute route, Matrix4 transform) {
evt = evt.transformed(transform);
route(evt);
}
catch (Exception ex) {

public void route(PointerEvent evt) {
HashSet<PointerRoute> routes;
// TODO: update this to latest version
Dictionary<PointerRoute, Matrix4> routes;
Dictionary<PointerRoute, Matrix4> copiedGlobalRoutes = new Dictionary<PointerRoute, Matrix4>(this._globalRoutes);
foreach (PointerRoute route in new List<PointerRoute>(routes)) {
if (routes.Contains(route)) {
this._dispatch(evt, route);
}
}
this._dispatchEventToRoutes(
evt,
routes,
new Dictionary<PointerRoute, Matrix4>(routes)
);
foreach (PointerRoute route in new List<PointerRoute>(this._globalRoutes)) {
if (this._globalRoutes.Contains(route)) {
this._dispatch(evt, route);
this._dispatchEventToRoutes(evt, this._globalRoutes, copiedGlobalRoutes);
}
public void _dispatchEventToRoutes(
PointerEvent evt,
Dictionary<PointerRoute, Matrix4> referenceRoutes,
Dictionary<PointerRoute, Matrix4> copiedRoutes
) {
foreach (var item in copiedRoutes) {
var route = item.Key;
var transform = item.Value;
if (referenceRoutes.ContainsKey(route)) {
this._dispatch(evt, route, transform);
}
}
// TODO: FlutterErrorDetailsForPointerRouter

4
com.unity.uiwidgets/Runtime/gestures/pointer_signal_resolver.cs


return;
}
D.assert(this._currentEvent == evt);
D.assert((_currentEvent.original ?? this._currentEvent) == evt);
this._firstRegisteredCallback(evt);
this._firstRegisteredCallback(_currentEvent);
}
catch (Exception exception) {
UIWidgetsError.reportError(new UIWidgetsErrorDetails(

100
com.unity.uiwidgets/Runtime/gestures/recognizer.cs


public abstract class GestureRecognizer : DiagnosticableTree, GestureArenaMember {
protected GestureRecognizer(object debugOwner = null, PointerDeviceKind? kind = null) {
this.debugOwner = debugOwner;
this._kind = kind;
this._kindFilter = kind;
readonly PointerDeviceKind? _kind;
readonly PointerDeviceKind? _kindFilter;
readonly Dictionary<int, PointerDeviceKind> _pointerToKind = new Dictionary<int, PointerDeviceKind>{};
this._pointerToKind[evt.pointer] = evt.kind;
if (this.isPointerAllowed(evt)) {
this.addAllowedPointer(evt);
}

}
protected virtual bool isPointerAllowed(PointerDownEvent evt) {
return this._kind == null || this._kind == evt.kind;
return this._kindFilter == null || this._kindFilter == evt.kind;
}
protected virtual PointerDeviceKind getKindForPointer(int pointer) {
D.assert(this._pointerToKind.ContainsKey(pointer));
return this._pointerToKind[pointer];
}
public virtual void addScrollPointer(PointerScrollEvent evt) {

}
}
protected virtual void resolvePointer(int pointer, GestureDisposition disposition) {
GestureArenaEntry entry = _entries[pointer];
if (entry != null) {
entry.resolve(disposition);
_entries.Remove(pointer);
}
}
public override void dispose() {
this.resolve(GestureDisposition.rejected);
foreach (int pointer in this._trackedPointers) {

}
}
protected void startTrackingPointer(int pointer) {
GestureBinding.instance.pointerRouter.addRoute(pointer, this.handleEvent);
protected void startTrackingPointer(int pointer, Matrix4 transform = null) {
GestureBinding.instance.pointerRouter.addRoute(pointer, this.handleEvent, transform);
this._trackedPointers.Add(pointer);
D.assert(!this._entries.ContainsKey(pointer));
this._entries[pointer] = this._addPointerToArena(pointer);

public int primaryPointer;
public Offset initialPosition;
public OffsetPair initialPosition;
this.startTrackingPointer(evt.pointer);
this.startTrackingPointer(evt.pointer, evt.transform);
this.initialPosition = evt.position;
this.initialPosition = new OffsetPair(local: evt.localPosition, global: evt.position);
this._timer = Window.instance.run(this.deadline.Value, this.didExceedDeadline);
this._timer = Window.instance.run(this.deadline.Value, () => didExceedDeadlineWithEvent(evt));
}
}
}

if (evt.pointer == this.primaryPointer) {
bool isPreAcceptSlopPastTolerance = this.state == GestureRecognizerState.possible &&
this.preAcceptSlopTolerance != null &&
this._getDistance(evt) > this.preAcceptSlopTolerance;
this._getGlobalDistance(evt) > this.preAcceptSlopTolerance;
this._getDistance(evt) > this.postAcceptSlopTolerance;
this._getGlobalDistance(evt) > this.postAcceptSlopTolerance;
if (evt is PointerMoveEvent && (isPreAcceptSlopPastTolerance || isPostAcceptSlopPastTolerance)) {
this.resolve(GestureDisposition.rejected);

D.assert(this.deadline == null);
}
protected virtual void didExceedDeadlineWithEvent(PointerDownEvent evt) {
this.didExceedDeadline();
}
this._stopTimer();
this.state = GestureRecognizerState.accepted;
}
}

}
}
float _getDistance(PointerEvent evt) {
Offset offset = evt.position - this.initialPosition;
float _getGlobalDistance(PointerEvent evt) {
Offset offset = evt.position - this.initialPosition.global;
return offset.distance;
}

}
}
public class OffsetPair {
/// Creates a [OffsetPair] combining a [local] and [global] [Offset].
public OffsetPair(
Offset local = null,
Offset global = null
) {
this.local = local;
this.global = global;
}
/// Creates a [OffsetPair] from [PointerEvent.localPosition] and
/// [PointerEvent.position].
public static OffsetPair fromEventPosition(PointerEvent evt) {
return new OffsetPair(local: evt.localPosition, global: evt.position);
}
/// Creates a [OffsetPair] from [PointerEvent.localDelta] and
/// [PointerEvent.delta].
public static OffsetPair fromEventDelta(PointerEvent evt) {
return new OffsetPair(local: evt.localDelta, global: evt.delta);
}
/// A [OffsetPair] where both [Offset]s are [Offset.zero].
public readonly static OffsetPair zero = new OffsetPair(local: Offset.zero, global: Offset.zero);
/// The [Offset] in the local coordinate space.
public readonly Offset local;
/// The [Offset] in the global coordinate space after conversion to logical
/// pixels.
public readonly Offset global;
/// Adds the `other.global` to [global] and `other.local` to [local].
public static OffsetPair operator +(OffsetPair current, OffsetPair other) {
return new OffsetPair(
local: current.local + other.local,
global: current.global + other.global
);
}
/// Subtracts the `other.global` from [global] and `other.local` from [local].
public static OffsetPair operator -(OffsetPair current, OffsetPair other) {
return new OffsetPair(
local: current.local - other.local,
global: current.global - other.global
);
}
public override string ToString() {
return $"runtimeType(local: ${this.local}, global: ${this.global})";
}
}
}

6
com.unity.uiwidgets/Runtime/gestures/tap.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;
namespace Unity.UIWidgets.gestures {
public class TapDownDetails {

}
protected override void handleTapDown(PointerDownEvent down) {
globalPosition: down.position,
globalPosition: down.position,
localPosition: down.localDelta,
kind: down.kind,
device: down.device
);

protected override void handleTapUp(PointerDownEvent down, PointerUpEvent up) {
TapUpDetails details = new TapUpDetails(
globalPosition: up.position,
localPosition: up.localPosition,
kind: up.kind,
device: up.device
);

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


additionalConstraints: additionalConstraints) {
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
if (!this.size.contains(position)) {
return false;
}

return new Size(deleteIconWidth, deleteIconHeight);
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
if (!this.size.contains(position)) {
return false;
}

2
com.unity.uiwidgets/Runtime/material/input_decorator.cs


return true;
}
protected override bool hitTestChildren(HitTestResult result, Offset position) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
D.assert(position != null);
foreach (RenderBox child in this._children) {
if (child.hitTest(result, position: position - _boxParentData(child).offset)) {

2
com.unity.uiwidgets/Runtime/material/list_tile.cs


return true;
}
protected override bool hitTestChildren(HitTestResult result, Offset position) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
D.assert(position != null);
foreach (RenderBox child in this._children) {
BoxParentData parentData = (BoxParentData) child.parentData;

78
com.unity.uiwidgets/Runtime/rendering/box.cs


}
}
public delegate bool BoxHitTest(BoxHitTestResult result, Offset position);
public class BoxHitTestResult : HitTestResult {
public BoxHitTestResult() : base() {
}
public BoxHitTestResult(HitTestResult result) : base(result) {
}
public bool addWithPaintTransform(
Matrix4 transform,
Offset position,
BoxHitTest hitTest
) {
D.assert(hitTest != null);
if (transform != null) {
transform = Matrix4.tryInvert(PointerEvent.removePerspectiveTransform(transform));
if (transform == null) {
// Objects are not visible on screen and cannot be hit-tested.
return false;
}
}
return this.addWithRawTransform(
transform: transform,
position: position,
hitTest: hitTest
);
}
public bool addWithPaintOffset(
Offset offset,
Offset position,
BoxHitTest hitTest
) {
D.assert(hitTest != null);
return this.addWithRawTransform(
transform: offset != null ? new Matrix4().translationValues(-offset.dx, -offset.dy, 0) : null,
position: position,
hitTest: hitTest
);
}
public bool addWithRawTransform(
Matrix4 transform,
Offset position,
BoxHitTest hitTest
) {
D.assert(hitTest != null);
Offset transformedPosition = position == null || transform == null
? position
: MatrixUtils.transformPoint(transform, position);
if (transform != null) {
this.pushTransform(transform);
}
bool isHit = hitTest(this, transformedPosition);
if (transform != null) {
this.popTransform();
}
return isHit;
}
}
public Offset offset = Offset.zero;
public Offset offset {
get { return this._offset; }
set { this._offset = value; }
}
Offset _offset = Offset.zero;
public override string ToString() {
return "offset=" + this.offset;

});
}
public virtual bool hitTest(HitTestResult result, Offset position = null) {
public virtual bool hitTest(BoxHitTestResult result, Offset position = null) {
D.assert(position != null);
D.assert(() => {
if (!this.hasSize) {

return false;
}
protected virtual bool hitTestChildren(HitTestResult result, Offset position = null) {
protected virtual bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return false;
}

return result;
}
public bool defaultHitTestChildren(HitTestResult result, Offset position = null) {
public bool defaultHitTestChildren(BoxHitTestResult result, Offset position = null) {
ChildType child = this.lastChild;
while (child != null) {
ParentDataType childParentData = (ParentDataType) child.parentData;

31
com.unity.uiwidgets/Runtime/rendering/box.mixin.gen.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using UnityEngine;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.ui;

}
}
public bool defaultHitTestChildren(HitTestResult result, Offset position) {
// the x, y parameters have the top left of the node's box as the origin
public bool defaultHitTestChildren(BoxHitTestResult result, Offset position) {
// the x, y parameters have the top left of the node's box as the origin4
while (child != null)
{
ParentDataType childParentData = (ParentDataType) child.parentData;
if (child.hitTest(result, position: position - childParentData.offset)) {
return true;
while (child != null) {
ParentDataType childParentData = child.parentData as ParentDataType;
bool isHit = result.addWithPaintOffset(
offset: childParentData.offset,
position: position,
hitTest: (BoxHitTestResult boxHitTestResult, Offset transformed) => {
D.assert(transformed == position - childParentData.offset);
return child.hitTest(boxHitTestResult, position: transformed);
);
if (isHit)
return true;
// ChildType child = this.lastChild;
// while (child != null)
// {
// ParentDataType childParentData = (ParentDataType) child.parentData;
// if (child.hitTest(result, position: position - childParentData.offset)) {
// return true;
// }
// child = childParentData.previousSibling;
// }
// return false;
}
public List<ChildType> getChildrenAsList() {

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


this.defaultPaint(context, offset);
}
protected override bool hitTestChildren(HitTestResult result, Offset position) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
return this.defaultHitTestChildren(result, position: position);
}
}

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


base.detach();
}
protected override bool hitTestChildren(HitTestResult result, Offset position) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
if (this._foregroundPainter != null && ((this._foregroundPainter.hitTest(position)) ?? false)) {
return true;
}

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


});
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return this.defaultHitTestChildren(result, position: position);
}
}

5
com.unity.uiwidgets/Runtime/rendering/layer.cs


using System.Linq;
using System.Text;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using UnityEngine;

internal override S find<S>(Offset regionOffset) {
if (this._inverseDirty) {
this._invertedTransform = Matrix4.tryInvert(this.transform);
this._invertedTransform = Matrix4.tryInvert(
PointerEvent.removePerspectiveTransform(this.transform)
);
this._inverseDirty = false;
}

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


}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return this.defaultHitTestChildren(result, position: position);
}
}

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


return null;
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null
) {
return false;
}

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


public HitTestBehavior behavior;
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
bool hitTarget = false;
if (this.size.contains(position)) {
hitTarget = this.hitTestChildren(result, position: position) || this.hitTestSelf(position);

get { return Offset.zero & this.size; }
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
if (this._clipper != null) {
this._updateClip();
D.assert(this._clip != null);

get { return this._borderRadius.toRRect(Offset.zero & this.size); }
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
if (this._clipper != null) {
this._updateClip();
D.assert(this._clip != null);

get { return Offset.zero & this.size; }
}
public override bool hitTest(HitTestResult result,
public override bool hitTest(BoxHitTestResult result,
Offset position = null
) {
this._updateClip();

}
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
D.assert(position != null);
if (this._clipper != null) {

}
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
if (this._clipper != null) {
this._updateClip();
D.assert(this._clip != null);

}
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
if (this._clipper != null) {
this._updateClip();
D.assert(this._clip != null);

}
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
if (this.transformHitTests) {
var transform = this._effectiveTransform;
var inverse = Matrix4.tryInvert(transform);

}
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
if (this.size.isEmpty) {
return false;
}

Offset _translation;
public override bool hitTest(HitTestResult result, Offset position) {
public override bool hitTest(BoxHitTestResult result, Offset position) {
protected override bool hitTestChildren(HitTestResult result, Offset position) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
D.assert(!this.debugNeedsLayout);
if (this.transformHitTests) {
position = new Offset(

bool _ignoring;
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
return this.ignoring ? false : base.hitTest(result, position: position);
}

}
}
public override bool hitTest(HitTestResult result, Offset position) {
public override bool hitTest(BoxHitTestResult result, Offset position) {
return !this.offstage && base.hitTest(result, position: position);
}

bool _absorbing;
public override bool hitTest(HitTestResult result, Offset position) {
public override bool hitTest(BoxHitTestResult result, Offset position) {
return this.absorbing
? this.size.contains(position)
: base.hitTest(result, position: position);

return this._layer?.getLastTransform() ?? new Matrix4().identity();
}
public override bool hitTest(HitTestResult result, Offset position) {
public override bool hitTest(BoxHitTestResult result, Offset position) {
protected override bool hitTestChildren(HitTestResult result, Offset position) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
Matrix4 inverse = Matrix4.tryInvert(this.getCurrentTransform());
if (inverse == null) {
return false;

2
com.unity.uiwidgets/Runtime/rendering/proxy_box.mixin.gen.cs


}
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
if (this.child != null) {
return this.child.hitTest(result, position);
}

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


}
protected override bool hitTestChildren(
HitTestResult result,
BoxHitTestResult result,
Offset position = null
) {
D.assert(this._paintTransform != null || this.debugNeedsLayout || this.child == null);

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


}
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
if (this.child != null) {
var childParentData = (BoxParentData) this.child.parentData;
return this.child.hitTest(result, position - childParentData.offset);

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


}
}
public class SliverHitTestResult : HitTestResult {
public delegate bool SliverHitTest(SliverHitTestResult result, float mainAxisPosition, float crossAxisPosition);
public SliverHitTestResult() : base() {
}
public SliverHitTestResult(HitTestResult result) : base(result) {
}
public bool addWithAxisOffset(
Offset paintOffset,
float mainAxisOffset,
float crossAxisOffset,
float mainAxisPosition,
float crossAxisPosition,
SliverHitTest hitTest
) {
D.assert(mainAxisOffset != null);
D.assert(crossAxisOffset != null);
D.assert(mainAxisPosition != null);
D.assert(crossAxisPosition != null);
D.assert(hitTest != null);
if (paintOffset != null) {
this.pushTransform(new Matrix4().translationValues(-paintOffset.dx, -paintOffset.dy, 0));
}
bool isHit = hitTest(
this,
mainAxisPosition: mainAxisPosition - mainAxisOffset,
crossAxisPosition: crossAxisPosition - crossAxisOffset
);
if (paintOffset != null) {
this.popTransform();
}
return isHit;
}
}
public class SliverHitTestEntry : HitTestEntry {
public SliverHitTestEntry(RenderSliver target,
float mainAxisPosition = 0.0f,

this.crossAxisPosition = crossAxisPosition;
}
public new RenderSliver target {
get { return (RenderSliver) base.target; }
}

get { return 0.0f; }
}
public bool hitTest(HitTestResult result, float mainAxisPosition = 0, float crossAxisPosition = 0) {
public bool hitTest(SliverHitTestResult result, float mainAxisPosition = 0, float crossAxisPosition = 0) {
if (mainAxisPosition >= 0.0f && mainAxisPosition < this.geometry.hitTestExtent &&
crossAxisPosition >= 0.0f && crossAxisPosition < this.constraints.crossAxisExtent) {
if (this.hitTestChildren(result, mainAxisPosition: mainAxisPosition,

return false;
}
protected virtual bool hitTestChildren(HitTestResult result, float mainAxisPosition = 0,
protected virtual bool hitTestChildren(SliverHitTestResult result, float mainAxisPosition = 0,
float crossAxisPosition = 0) {
return false;
}

return null;
}
protected Size getAbsoluteSize() {
D.assert(this.geometry != null);
D.assert(!this.debugNeedsLayout);
switch (this.constraints.axisDirection) {
case AxisDirection.up:
case AxisDirection.down:
return new Size(this.constraints.crossAxisExtent, this.geometry.paintExtent);
case AxisDirection.right:
case AxisDirection.left:
return new Size(this.geometry.paintExtent, this.constraints.crossAxisExtent);
}
return null;
}
void _debugDrawArrow(Canvas canvas, Paint paint, Offset p0, Offset p1, GrowthDirection direction) {
D.assert(() => {
if (p0 == p1) {

return rightWayUp;
}
public static bool hitTestBoxChild(this RenderSliver it, HitTestResult result, RenderBox child,
public static bool hitTestBoxChild(this RenderSliver it, BoxHitTestResult result, RenderBox child,
float absolutePosition = mainAxisPosition - it.childMainAxisPosition(child);
float absoluteCrossAxisPosition = crossAxisPosition - it.childCrossAxisPosition(child);
float delta = it.childMainAxisPosition(child);
float crossAxisDelta = it.childCrossAxisPosition(child);
float absolutePosition = mainAxisPosition - delta;
float absoluteCrossAxisPosition = crossAxisPosition - crossAxisDelta;
Offset paintOffset = null;
Offset transformedPosition = null;
D.assert(it.constraints.axis != null);
case Axis.horizontal:
if (!rightWayUp) {
absolutePosition = child.size.width - absolutePosition;
}
return child.hitTest(result,
position: new Offset(absolutePosition, absoluteCrossAxisPosition));
case Axis.vertical:
if (!rightWayUp) {
absolutePosition = child.size.height - absolutePosition;
}
return child.hitTest(result,
position: new Offset(absoluteCrossAxisPosition, absolutePosition));
case Axis.horizontal:
if (!rightWayUp) {
absolutePosition = child.size.width - absolutePosition;
delta = it.geometry.paintExtent - child.size.width - delta;
}
paintOffset = new Offset(delta, crossAxisDelta);
transformedPosition = new Offset(absolutePosition, absoluteCrossAxisPosition);
break;
case Axis.vertical:
if (!rightWayUp) {
absolutePosition = child.size.height - absolutePosition;
delta = it.geometry.paintExtent - child.size.height - delta;
}
paintOffset = new Offset(crossAxisDelta, delta);
transformedPosition = new Offset(absoluteCrossAxisPosition, absolutePosition);
break;
return false;
D.assert(paintOffset != null);
D.assert(transformedPosition != null);
return result.addWithPaintOffset(
offset: paintOffset,
position: null, // Manually adapting from sliver to box position above.
hitTest: (BoxHitTestResult boxHitTestResult, Offset _) => {
return child.hitTest(boxHitTestResult, position: transformedPosition);
}
);
}
public static void applyPaintTransformForBoxChild(this RenderSliver it, RenderBox child,

}
}
protected override bool hitTestChildren(HitTestResult result, float mainAxisPosition = 0.0f,
protected override bool hitTestChildren(SliverHitTestResult result, float mainAxisPosition = 0.0f,
return this.hitTestBoxChild(result, this.child, mainAxisPosition: mainAxisPosition,
return this.hitTestBoxChild(new BoxHitTestResult(result), this.child, mainAxisPosition: mainAxisPosition,
crossAxisPosition: crossAxisPosition);
}

6
com.unity.uiwidgets/Runtime/rendering/sliver_multi_box_adaptor.cs


return 0.0f;
}
protected override bool hitTestChildren(HitTestResult result, float mainAxisPosition = 0.0f,
protected override bool hitTestChildren(SliverHitTestResult result, float mainAxisPosition = 0.0f,
BoxHitTestResult boxResult = new BoxHitTestResult(result);
if (this.hitTestBoxChild(result, child, mainAxisPosition: mainAxisPosition,
if (this.hitTestBoxChild(boxResult, child, mainAxisPosition: mainAxisPosition,
crossAxisPosition: crossAxisPosition)) {
return true;
}

11
com.unity.uiwidgets/Runtime/rendering/sliver_padding.cs


D.assert(crossAxisPadding == this.crossAxisPadding);
}
protected override bool hitTestChildren(HitTestResult result, float mainAxisPosition = 0.0f,
protected override bool hitTestChildren(SliverHitTestResult result, float mainAxisPosition = 0.0f,
SliverPhysicalParentData childParentData = this.child.parentData as SliverPhysicalParentData;
result.addWithAxisOffset(
mainAxisPosition: mainAxisPosition,
crossAxisPosition: crossAxisPosition,
mainAxisOffset: this.childMainAxisPosition(this.child),
crossAxisOffset: this.childCrossAxisPosition(this.child),
paintOffset: childParentData.paintOffset,
hitTest: this.child.hitTest
);
return this.child.hitTest(result,
mainAxisPosition: mainAxisPosition - this.childMainAxisPosition(this.child),
crossAxisPosition: crossAxisPosition - this.childCrossAxisPosition(this.child));

4
com.unity.uiwidgets/Runtime/rendering/sliver_persistent_header.cs


return base.childMainAxisPosition(this.child);
}
protected override bool hitTestChildren(HitTestResult result, float mainAxisPosition, float crossAxisPosition) {
protected override bool hitTestChildren(SliverHitTestResult result, float mainAxisPosition, float crossAxisPosition) {
return RenderSliverHelpers.hitTestBoxChild(this, result, this.child, mainAxisPosition: mainAxisPosition,
return RenderSliverHelpers.hitTestBoxChild(this, new BoxHitTestResult(result), this.child, mainAxisPosition: mainAxisPosition,
crossAxisPosition: crossAxisPosition);
}

65
com.unity.uiwidgets/Runtime/rendering/stack.cs


}
}
public static float getIntrinsicDimension(RenderBox firstChild, mainChildSizeGetter getter) {
float extent = 0;
RenderBox child = firstChild;
while (child != null) {
StackParentData childParentData = child.parentData as StackParentData;
if (!childParentData.isPositioned)
extent = Math.Max(extent, getter(child));
D.assert(child.parentData == childParentData);
child = childParentData.nextSibling;
}
return extent;
}
public delegate float mainChildSizeGetter(RenderBox child);
float _getIntrinsicDimension(mainChildSizeGetter getter) {

protected override float? computeDistanceToActualBaseline(TextBaseline baseline) {
return this.defaultComputeDistanceToHighestActualBaseline(baseline);
}
public static bool layoutPositionedChild(RenderBox child, StackParentData childParentData, Size size, Alignment alignment) {
D.assert(childParentData.isPositioned);
D.assert(child.parentData == childParentData);
bool hasVisualOverflow = false;
BoxConstraints childConstraints = new BoxConstraints();
if (childParentData.left != null && childParentData.right != null)
childConstraints = childConstraints.tighten(width: size.width - childParentData.right - childParentData.left);
else if (childParentData.width != null)
childConstraints = childConstraints.tighten(width: childParentData.width);
if (childParentData.top != null && childParentData.bottom != null)
childConstraints = childConstraints.tighten(height: size.height - childParentData.bottom - childParentData.top);
else if (childParentData.height != null)
childConstraints = childConstraints.tighten(height: childParentData.height);
child.layout(childConstraints, parentUsesSize: true);
float? x;
if (childParentData.left != null) {
x = childParentData.left;
} else if (childParentData.right != null) {
x = size.width - childParentData.right - child.size.width;
} else {
x = alignment.alongOffset(size - child.size as Offset).dx;
}
if (x < 0.0 || x + child.size.width > size.width)
hasVisualOverflow = true;
float? y;
if (childParentData.top != null) {
y = childParentData.top;
} else if (childParentData.bottom != null) {
y = size.height - childParentData.bottom - child.size.height;
} else {
y = alignment.alongOffset(size - child.size as Offset).dy;
}
if (y < 0.0 || y + child.size.height > size.height)
hasVisualOverflow = true;
childParentData.offset = new Offset(x ?? 0, y ?? 0);
return hasVisualOverflow;
}
protected override void performLayout() {
this._hasVisualOverflow = false;

}
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return this.defaultHitTestChildren(result, position: position);
}

return child;
}
protected override bool hitTestChildren(HitTestResult result, Offset position) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
if (this.firstChild == null || this.index == null) {
return false;
}

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


D.assert(this._rowTops.Count == rows + 1);
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
D.assert(this._children.Count == this.rows * this.columns);
for (int index = this._children.Count - 1; index >= 0; index--) {
RenderBox child = this._children[index];

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


public bool hitTest(HitTestResult result, Offset position = null) {
if (this.child != null) {
this.child.hitTest(result, position: position);
this.child.hitTest(new BoxHitTestResult(result), position: position);
}
result.add(new HitTestEntry(this));

25
com.unity.uiwidgets/Runtime/rendering/viewport.cs


});
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
D.assert(position != null);
float mainAxisPosition = 0, crossAxisPosition = 0;

break;
}
SliverHitTestResult sliverResult = new SliverHitTestResult(result);
if (child.geometry.visible && child.hitTest(
result,
mainAxisPosition: this.computeChildMainAxisPosition(child, mainAxisPosition),
crossAxisPosition: crossAxisPosition
)) {
if (!child.geometry.visible) {
continue;
}
Matrix4 transform = new Matrix4().identity();
this.applyPaintTransform(child, transform);
bool isHit = result.addWithPaintTransform(
transform: transform,
position: null, // Manually adapting from box to sliver position below.
hitTest: (BoxHitTestResult result, Offset _) => {
return child.hitTest(
sliverResult,
mainAxisPosition: this.computeChildMainAxisPosition(child, mainAxisPosition),
crossAxisPosition: crossAxisPosition
);
}
);
if (isHit) {
return true;
}
}

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


}
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return this.defaultHitTestChildren(result, position: position);
}

34
com.unity.uiwidgets/Runtime/ui/Matrix4.cs


return this;
}
public void setColumn(int column, Vector4 arg) {
int entry = column * 4;
this._m4storage[entry + 3] = arg[3];
this._m4storage[entry + 2] = arg[2];
this._m4storage[entry + 1] = arg[1];
this._m4storage[entry + 0] = arg[0];
}
public Vector4 getColumn(int column) {
Vector4 r = new Vector4();
int entry = column * 4;
r[3] = this._m4storage[entry + 3];
r[2] = this._m4storage[entry + 2];
r[1] = this._m4storage[entry + 1];
r[0] = this._m4storage[entry + 0];
return r;
}
public void setRow(int row, Vector4 arg) {
this._m4storage[this.index(row, 0)] = arg[0];
this._m4storage[this.index(row, 1)] = arg[1];
this._m4storage[this.index(row, 2)] = arg[2];
this._m4storage[this.index(row, 3)] = arg[3];
}
public Vector4 getRow(int row) {
Vector4 r = new Vector4();
r[0] = this._m4storage[this.index(row, 0)];
r[1] = this._m4storage[this.index(row, 1)];
r[2] = this._m4storage[this.index(row, 2)];
r[3] = this._m4storage[this.index(row, 3)];
return r;
}
public Matrix4 clone() => new Matrix4().copy(this);
public static Matrix4 operator *(Matrix4 a, Matrix4 b) {

2
com.unity.uiwidgets/Runtime/widgets/layout_builder.cs


}
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return this.child?.hitTest(result, position: position) ?? false;
}

2
com.unity.uiwidgets/Runtime/widgets/nested_scroll_view.cs


}
protected override bool hitTestChildren(
HitTestResult result,
SliverHitTestResult result,
float mainAxisPosition = 0,
float crossAxisPosition = 0
) {

491
com.unity.uiwidgets/Runtime/widgets/overlay.cs


using System.Collections.Generic;
using System;
using System.Collections.Generic;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.widgets {
public class OverlayEntry {

}
this._opaque = value;
D.assert(this._overlay != null);
this._overlay._didChangeEntryOpacity();
this._overlay?._didChangeEntryOpacity();
}
}

internal OverlayState _overlay;
internal readonly GlobalKey<_OverlayEntryState> _key = new LabeledGlobalKey<_OverlayEntryState>();
internal readonly GlobalKey<_OverlayEntryWidgetState> _key = new LabeledGlobalKey<_OverlayEntryWidgetState>();
public void remove() {
D.assert(this._overlay != null);

}
class _OverlayEntry : StatefulWidget {
internal _OverlayEntry(OverlayEntry entry) : base(key: entry._key) {
class _OverlayEntryWidget : StatefulWidget {
internal _OverlayEntryWidget(Key key, OverlayEntry entry, bool tickerEnabled = true) : base(key: key) {
D.assert(key != null);
this.tickerEnabled = tickerEnabled;
public readonly bool tickerEnabled;
return new _OverlayEntryState();
return new _OverlayEntryWidgetState();
class _OverlayEntryState : State<_OverlayEntry> {
class _OverlayEntryWidgetState : State<_OverlayEntryWidget> {
public override Widget build(BuildContext context) {
return this.widget.entry.builder(context);
}

entry._overlay = this;
}
this.setState(() => {
this._entries.InsertRange(this._insertionIndex(below, above), entries);
});
this.setState(() => { this._entries.InsertRange(this._insertionIndex(below, above), entries); });
public void rearrange(IEnumerable<OverlayEntry> newEntries, OverlayEntry below = null, OverlayEntry above = null) {
public void rearrange(IEnumerable<OverlayEntry> newEntries, OverlayEntry below = null,
OverlayEntry above = null) {
newEntries is List<OverlayEntry> ?(newEntries as List<OverlayEntry>) : newEntries.ToList();
newEntries is List<OverlayEntry> ? (newEntries as List<OverlayEntry>) : newEntries.ToList();
D.assert(above == null || below == null, () => "Only one of `above` and `below` may be specified.");
D.assert(above == null || (above._overlay == this && this._entries.Contains(above)),
() => "The provided entry for `above` is not present in the Overlay.");

}
HashSet<OverlayEntry> old = new HashSet<OverlayEntry>(this._entries);
foreach(OverlayEntry entry in newEntriesList) {
foreach (OverlayEntry entry in newEntriesList) {
this.setState(() => {
this._entries.Clear();
this._entries.AddRange(newEntriesList);

}
public override Widget build(BuildContext context) {
var onstageChildren = new List<Widget>();
var offstageChildren = new List<Widget>();
var children = new List<Widget>();
int onstageCount = 0;
onstageChildren.Add(new _OverlayEntry(entry));
onstageCount += 1;
children.Add(new _OverlayEntryWidget(entry._key, entry));
offstageChildren.Add(new TickerMode(enabled: false, child: new _OverlayEntry(entry)));
children.Add(new _OverlayEntryWidget(
key: entry._key,
entry: entry,
tickerEnabled: false
));
onstageChildren.Reverse();
children.Reverse();
onstage: new Stack(
fit: StackFit.expand,
children: onstageChildren
),
offstage: offstageChildren
skipCount: children.Count - onstageCount,
children: children.ToList()
// onstage: new Stack(
// fit: StackFit.expand,
// children: onstageChildren
// ),
// offstage: offstageChildren
class _Theatre : RenderObjectWidget {
internal _Theatre(Stack onstage = null, List<Widget> offstage = null) {
class _Theatre : MultiChildRenderObjectWidget {
internal _Theatre(Key key = null,
int skipCount = 0,
List<Widget> children = null) : base(key, children) {
public readonly int skipCount;
public readonly Stack onstage;

}
public override RenderObject createRenderObject(BuildContext context) {
return new _RenderTheatre();
return new _RenderTheatre(
skipCount: this.skipCount,
textDirection: Directionality.of(context));
}
public void updateRenderObject(BuildContext context, _RenderTheatre renderObject) {
renderObject.skipCount = this.skipCount;
renderObject.textDirection = Directionality.of(context);
class _TheatreElement : RenderObjectElement {
public _TheatreElement(RenderObjectWidget widget) : base(widget) {
class _TheatreElement : MultiChildRenderObjectElement {
public _TheatreElement(_Theatre widget) : base(widget) {
D.assert(!WidgetsD.debugChildrenHaveDuplicateKeys(widget, ((_Theatre) widget).offstage));
}

get { return (_RenderTheatre) base.renderObject; }
}
Element _onstage;
static readonly object _onstageSlot = new object();
public override void debugVisitOnstageChildren(ElementVisitor visitor) {
D.assert(this.children.Count() >= this.widget.skipCount);
foreach (var item in this.children.Skip(this.widget.skipCount)) {
visitor(item);
}
}
}
List<Element> _offstage;
readonly HashSet<Element> _forgottenOffstageChildren = new HashSet<Element>();
// Element _onstage;
// static readonly object _onstageSlot = new object();
//
// List<Element> _offstage;
// readonly HashSet<Element> _forgottenOffstageChildren = new HashSet<Element>();
//
// protected override void insertChildRenderObject(RenderObject child, object slot) {
// D.assert(this.renderObject.debugValidateChild(child));
// if (slot == _onstageSlot) {
// D.assert(child is RenderStack);
// this.renderObject.child = (RenderStack) child;
// }
// else {
// D.assert(slot == null || slot is Element);
// this.renderObject.insert((RenderBox) child, after: (RenderBox) ((Element) slot)?.renderObject);
// }
// }
//
// protected override void moveChildRenderObject(RenderObject child, object slot) {
// if (slot == _onstageSlot) {
// this.renderObject.remove((RenderBox) child);
// D.assert(child is RenderStack);
// this.renderObject.child = (RenderStack) child;
// }
// else {
// D.assert(slot == null || slot is Element);
// if (this.renderObject.child == child) {
// this.renderObject.child = null;
// this.renderObject.insert((RenderBox) child, after: (RenderBox) ((Element) slot)?.renderObject);
// }
// else {
// this.renderObject.move((RenderBox) child, after: (RenderBox) ((Element) slot)?.renderObject);
// }
// }
// }
//
// protected override void removeChildRenderObject(RenderObject child) {
// if (this.renderObject.child == child) {
// this.renderObject.child = null;
// }
// else {
// this.renderObject.remove((RenderBox) child);
// }
// }
//
// public override void visitChildren(ElementVisitor visitor) {
// if (this._onstage != null) {
// visitor(this._onstage);
// }
//
// foreach (var child in this._offstage) {
// if (!this._forgottenOffstageChildren.Contains(child)) {
// visitor(child);
// }
// }
// }
//
// // public override void debugVisitOnstageChildren(ElementVisitor visitor) {
// // if (this._onstage != null) {
// // visitor(this._onstage);
// // }
// // }
//
//
// protected override void forgetChild(Element child) {
// if (child == this._onstage) {
// this._onstage = null;
// }
// else {
// D.assert(this._offstage.Contains(child));
// D.assert(!this._forgottenOffstageChildren.Contains(child));
// this._forgottenOffstageChildren.Add(child);
// }
// }
//
// public override void mount(Element parent, object newSlot) {
// base.mount(parent, newSlot);
// this._onstage = this.updateChild(this._onstage, this.widget.onstage, _onstageSlot);
// this._offstage = new List<Element>(this.widget.offstage.Count);
// Element previousChild = null;
// for (int i = 0; i < this._offstage.Count; i += 1) {
// var newChild = this.inflateWidget(this.widget.offstage[i], previousChild);
// this._offstage[i] = newChild;
// previousChild = newChild;
// }
// }
//
// public override void update(Widget newWidget) {
// base.update(newWidget);
// D.assert(Equals(this.widget, newWidget));
// this._onstage = this.updateChild(this._onstage, this.widget.onstage, _onstageSlot);
// this._offstage = this.updateChildren(this._offstage, this.widget.offstage,
// forgottenChildren: this._forgottenOffstageChildren);
// this._forgottenOffstageChildren.Clear();
// }
// }
class _RenderTheatre :
ContainerRenderObjectMixinRenderProxyBoxMixinRenderObjectWithChildMixinRenderBoxRenderStack<
RenderBox, StackParentData> {
internal _RenderTheatre(
TextDirection textDirection,
List<RenderBox> children = null,
int skipCount = 0
) {
D.assert(skipCount != null);
D.assert(skipCount >= 0);
D.assert(textDirection != null);
this._textDirection = textDirection;
this._skipCount = skipCount;
this.addAll(children);
}
protected override void insertChildRenderObject(RenderObject child, object slot) {
D.assert(this.renderObject.debugValidateChild(child));
if (slot == _onstageSlot) {
D.assert(child is RenderStack);
this.renderObject.child = (RenderStack) child;
}
else {
D.assert(slot == null || slot is Element);
this.renderObject.insert((RenderBox) child, after: (RenderBox) ((Element) slot)?.renderObject);
bool _hasVisualOverflow = false;
Alignment _resolvedAlignment;
void _resolve() {
if (this._resolvedAlignment != null)
return;
// TODO: AlignmentDirectional
Alignment al = Alignment.topLeft;
switch (this.textDirection) {
case TextDirection.rtl:
this._resolvedAlignment = new Alignment(-1, -1);
break;
case TextDirection.ltr:
this._resolvedAlignment = new Alignment(1, -1);
break;
protected override void moveChildRenderObject(RenderObject child, object slot) {
if (slot == _onstageSlot) {
this.renderObject.remove((RenderBox) child);
D.assert(child is RenderStack);
this.renderObject.child = (RenderStack) child;
}
else {
D.assert(slot == null || slot is Element);
if (this.renderObject.child == child) {
this.renderObject.child = null;
this.renderObject.insert((RenderBox) child, after: (RenderBox) ((Element) slot)?.renderObject);
}
else {
this.renderObject.move((RenderBox) child, after: (RenderBox) ((Element) slot)?.renderObject);
}
}
void _markNeedResolution() {
this._resolvedAlignment = null;
this.markNeedsLayout();
protected override void removeChildRenderObject(RenderObject child) {
if (this.renderObject.child == child) {
this.renderObject.child = null;
}
else {
this.renderObject.remove((RenderBox) child);
public TextDirection textDirection {
get { return this._textDirection; }
set {
if (this._textDirection == value)
return;
this._textDirection = value;
this._markNeedResolution();
public override void visitChildren(ElementVisitor visitor) {
if (this._onstage != null) {
visitor(this._onstage);
}
TextDirection _textDirection;
foreach (var child in this._offstage) {
if (!this._forgottenOffstageChildren.Contains(child)) {
visitor(child);
public int skipCount {
get { return this._skipCount; }
set {
D.assert(value != null);
if (this._skipCount != value) {
this._skipCount = value;
this.markNeedsLayout();
public override void debugVisitOnstageChildren(ElementVisitor visitor) {
if (this._onstage != null) {
visitor(this._onstage);
}
}
int _skipCount;
RenderBox _firstOnstageChild {
get {
if (this.skipCount == base.childCount) {
return null;
}
protected override void forgetChild(Element child) {
if (child == this._onstage) {
this._onstage = null;
}
else {
D.assert(this._offstage.Contains(child));
D.assert(!this._forgottenOffstageChildren.Contains(child));
this._forgottenOffstageChildren.Add(child);
}
}
RenderBox child = base.firstChild;
for (int toSkip = this.skipCount; toSkip > 0; toSkip--) {
StackParentData childParentData = child.parentData as StackParentData;
child = childParentData.nextSibling;
D.assert(child != null);
}
public override void mount(Element parent, object newSlot) {
base.mount(parent, newSlot);
this._onstage = this.updateChild(this._onstage, this.widget.onstage, _onstageSlot);
this._offstage = new List<Element>(this.widget.offstage.Count);
Element previousChild = null;
for (int i = 0; i < this._offstage.Count; i += 1) {
var newChild = this.inflateWidget(this.widget.offstage[i], previousChild);
this._offstage[i] = newChild;
previousChild = newChild;
return child;
public override void update(Widget newWidget) {
base.update(newWidget);
D.assert(Equals(this.widget, newWidget));
this._onstage = this.updateChild(this._onstage, this.widget.onstage, _onstageSlot);
this._offstage = this.updateChildren(this._offstage, this.widget.offstage,
forgottenChildren: this._forgottenOffstageChildren);
this._forgottenOffstageChildren.Clear();
}
}
class _RenderTheatre :
ContainerRenderObjectMixinRenderProxyBoxMixinRenderObjectWithChildMixinRenderBoxRenderStack<
RenderBox, StackParentData> {
public override void setupParentData(RenderObject child) {
if (!(child.parentData is StackParentData)) {
child.parentData = new StackParentData();

return children;
}
RenderBox _lastOnstageChild {
get { return this.skipCount == this.childCount ? null : this.lastChild; }
}
int _onstageChildCount {
get { return this.childCount - this.skipCount; }
}
protected override float computeMinIntrinsicWidth(float height) {
return RenderStack.getIntrinsicDimension(this._firstOnstageChild,
(RenderBox child) => child.getMinIntrinsicWidth(height));
}
protected override float computeMaxIntrinsicWidth(float height) {
return RenderStack.getIntrinsicDimension(this._firstOnstageChild,
(RenderBox child) => child.getMaxIntrinsicWidth(height));
}
protected override float computeMinIntrinsicHeight(float width) {
return RenderStack.getIntrinsicDimension(this._firstOnstageChild,
(RenderBox child) => child.getMinIntrinsicHeight(width));
}
protected internal override float computeMaxIntrinsicHeight(float width) {
return RenderStack.getIntrinsicDimension(this._firstOnstageChild,
(RenderBox child) => child.getMaxIntrinsicHeight(width));
}
protected override float? computeDistanceToActualBaseline(TextBaseline baseline) {
D.assert(!this.debugNeedsLayout);
float? result = null;
RenderBox child = this._firstOnstageChild;
while (child != null) {
D.assert(!child.debugNeedsLayout);
StackParentData childParentData = child.parentData as StackParentData;
float? candidate = child.getDistanceToActualBaseline(baseline);
if (candidate != null) {
candidate += childParentData.offset.dy;
if (result != null) {
result = Math.Min(result.Value, candidate.Value);
} else {
result = candidate;
}
}
child = childParentData.nextSibling;
}
return result;
}
protected override bool sizedByParent {
get { return true; }
}
protected override void performResize() {
this.size = this.constraints.biggest;
D.assert(this.size.isFinite);
}
protected override void performLayout() {
this._hasVisualOverflow = false;
if (this._onstageChildCount == 0) {
return;
}
this._resolve();
D.assert(this._resolvedAlignment != null);
// Same BoxConstraints as used by RenderStack for StackFit.expand.
BoxConstraints nonPositionedConstraints = BoxConstraints.tight(this.constraints.biggest);
RenderBox child = this._firstOnstageChild;
while (child != null) {
StackParentData childParentData = child.parentData as StackParentData;
if (!childParentData.isPositioned) {
child.layout(nonPositionedConstraints, parentUsesSize: true);
childParentData.offset = this._resolvedAlignment.alongOffset(this.size - child.size as Offset);
} else {
this._hasVisualOverflow = RenderStack.layoutPositionedChild(child, childParentData, this.size, this._resolvedAlignment) || _hasVisualOverflow;
}
D.assert(child.parentData == childParentData);
child = childParentData.nextSibling;
}
}
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
RenderBox child = this._lastOnstageChild;
for (int i = 0; i < this._onstageChildCount; i++) {
D.assert(child != null);
StackParentData childParentData = child.parentData as StackParentData;
if (childParentData.offset.dx != 0 || childParentData.offset.dy != 0) {
i = i;
}
bool isHit = result.addWithPaintOffset(
offset: childParentData.offset,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset transformed) => {
D.assert(transformed == position - childParentData.offset);
return child.hitTest(resultIn, position: transformed);
}
);
if (isHit)
return true;
child = childParentData.previousSibling;
}
return false;
}
void paintStack(PaintingContext context, Offset offset) {
RenderBox child = this._firstOnstageChild;
while (child != null) {
StackParentData childParentData = child.parentData as StackParentData;
context.paintChild(child, childParentData.offset + offset);
child = childParentData.nextSibling;
}
}
public override void paint(PaintingContext context, Offset offset) {
if (this._hasVisualOverflow) {
context.pushClipRect(this.needsCompositing, offset, Offset.zero & this.size, this.paintStack);
} else {
this.paintStack(context, offset);
}
}
void visitChildrenForSemantics(RenderObjectVisitor visitor) {
RenderBox child = this._firstOnstageChild;
while (child != null) {
visitor(child);
StackParentData childParentData = child.parentData as StackParentData;
child = childParentData.nextSibling;
}
}
public override Rect describeApproximatePaintClip(RenderObject child) => this._hasVisualOverflow ? Offset.zero & this.size : null;
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new IntProperty("skipCount", this.skipCount));
properties.add(new EnumProperty<TextDirection>("textDirection", this.textDirection));
}
// bool hitTestChildren(BoxHitTestResult result, { Offset position }) {
// RenderBox child = _lastOnstageChild;
// for (int i = 0; i < _onstageChildCount; i++) {
// assert(child != null);
// final StackParentData childParentData = child.parentData as StackParentData;
// final bool isHit = result.addWithPaintOffset(
// offset: childParentData.offset,
// position: position,
// hitTest: (BoxHitTestResult result, Offset transformed) {
// assert(transformed == position - childParentData.offset);
// return child.hitTest(result, position: transformed);
// },
// );
// if (isHit)
// return true;
// child = childParentData.previousSibling;
// }
// return false;
// }
}
}

2
com.unity.uiwidgets/Runtime/widgets/single_child_scroll_view.cs


return null;
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
if (this.child != null) {
Offset transformed = position + (-this._paintOffset);
return this.child.hitTest(result, position: transformed);

正在加载...
取消
保存