stuyam / pressure

:point_down::boom: JavaScript library for handling Force Touch, 3D Touch, and Pointer Pressure.
https://pressurejs.com
MIT License
2.92k stars 97 forks source link

Force value out of range #82

Open urikjaro opened 4 years ago

urikjaro commented 4 years ago

During our test we have received force (pressure) values above 1.0 like 1.2 or 1.777... The API states that values can range from 0....1.

change: function(force, event){
    // this is called every time there is a change in pressure
    // force will always be a value from 0 to 1 on mobile and desktop
  },

The user agent string is: "Mozilla/5.0 (Linux; Android 9; EML-L29 Build/HUAWEIEML-L29; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.92 Mobile Safari/537.36" which would point to Huawei P20. Unfortunately I do not have more info, since this was only intercepted on our backend, without the access to the device.

Lonzak commented 4 years ago

We have the same problem. Is there a way to get the minimum and maximum values? In that case we could remap the range back to 0...1.