mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
fixes android pressure range (#7516)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user