Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit 86f947d

Browse files
committed
keep mouse_track behavior all the same as in flutter
1 parent 2ac2cac commit 86f947d

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Runtime/gestures/mouse_tracking.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,19 @@ void exitAllDevices(_TrackedAnnotation trackedAnnotation) {
168168
}
169169

170170
_TrackedAnnotation hitAnnotation = this._findAnnotation(hit);
171+
//enter
172+
if (!hitAnnotation.activeDevices.Contains(deviceId)) {
173+
hitAnnotation.activeDevices.Add(deviceId);
174+
if (hitAnnotation.annotation?.onEnter != null) {
175+
hitAnnotation.annotation.onEnter(PointerEnterEvent.fromHoverEvent(lastEvent));
176+
}
177+
}
178+
179+
//hover
180+
if (hitAnnotation.annotation?.onHover != null) {
181+
hitAnnotation.annotation.onHover(PointerHoverEvent.fromHoverEvent(lastEvent));
182+
}
183+
171184
//leave
172185
foreach (_TrackedAnnotation trackedAnnotation in this._trackedAnnotations.Values) {
173186
if (hitAnnotation == trackedAnnotation) {
@@ -182,19 +195,6 @@ void exitAllDevices(_TrackedAnnotation trackedAnnotation) {
182195
trackedAnnotation.activeDevices.Remove(deviceId);
183196
}
184197
}
185-
186-
//enter
187-
if (!hitAnnotation.activeDevices.Contains(deviceId)) {
188-
hitAnnotation.activeDevices.Add(deviceId);
189-
if (hitAnnotation.annotation?.onEnter != null) {
190-
hitAnnotation.annotation.onEnter(PointerEnterEvent.fromHoverEvent(lastEvent));
191-
}
192-
}
193-
194-
//hover
195-
if (hitAnnotation.annotation?.onHover != null) {
196-
hitAnnotation.annotation.onHover(PointerHoverEvent.fromHoverEvent(lastEvent));
197-
}
198198
}
199199
}
200200
}

0 commit comments

Comments
 (0)