mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
fixes android pressure range (flutter/engine#7516)
This commit is contained in:
parent
8d6ec47a36
commit
9b55d2ced1
@ -474,11 +474,10 @@ public class FlutterView extends SurfaceView
|
||||
|
||||
packet.putLong(0); // obscured
|
||||
|
||||
// TODO(eseidel): Could get the calibrated range if necessary:
|
||||
// event.getDevice().getMotionRange(MotionEvent.AXIS_PRESSURE)
|
||||
InputDevice.MotionRange pressureRange = event.getDevice().getMotionRange(MotionEvent.AXIS_PRESSURE);
|
||||
packet.putDouble(event.getPressure(pointerIndex)); // pressure
|
||||
packet.putDouble(0.0); // pressure_min
|
||||
packet.putDouble(1.0); // pressure_max
|
||||
packet.putDouble(pressureRange.getMin()); // pressure_min
|
||||
packet.putDouble(pressureRange.getMax()); // pressure_max
|
||||
|
||||
if (pointerKind == kPointerDeviceKindStylus) {
|
||||
packet.putDouble(event.getAxisValue(MotionEvent.AXIS_DISTANCE, pointerIndex)); // distance
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user