Propagate positions of secondary pointers in UP events on Android (#23797)

This commit is contained in:
Stanislav Baranov
2018-11-05 12:43:00 -08:00
committed by GitHub
parent 7245c4a6f6
commit ba4cf054bd
6 changed files with 42 additions and 27 deletions

View File

@@ -95,23 +95,6 @@ void diffPointerCoordsList(StringBuffer diffBuffer,
return;
}
if (isSinglePointerAction(originalEvent['action'])) {
final int idx = getPointerIdx(originalEvent['action']);
final Map<String, dynamic> expected =
expectedList[idx].cast<String, dynamic>();
final Map<String, dynamic> actual = actualList[idx].cast<String, dynamic>();
diffPointerCoords(expected, actual, idx, diffBuffer);
// For POINTER_UP and POINTER_DOWN events the engine drops the data for all pointers
// but for the pointer that was taken up/down.
// See: https://github.com/flutter/flutter/issues/19882
//
// Until that issue is resolved, we only compare the pointer for which the action
// applies to here.
//
// TODO(amirh): Compare all pointers once the issue mentioned above is resolved.
return;
}
for (int i = 0; i < expectedList.length; i++) {
final Map<String, dynamic> expected =
expectedList[i].cast<String, dynamic>();
@@ -151,12 +134,6 @@ void diffMaps(
}
}
bool isSinglePointerAction(int action) {
final int actionMasked = getActionMasked(action);
return actionMasked == 5 || // POINTER_DOWN
actionMasked == 6; // POINTER_UP
}
int getActionMasked(int action) => action & 0xff;
int getPointerIdx(int action) => (action >> 8) & 0xff;