forked from qt-creator/qt-creator
Doc: update Accelbubble example
The app could not recover from receiving a NaN value from the Accelerometer, so NaN values are ignored. Change-Id: Ia33d800f7fe080e07dcf327c26b3772e994793bf Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
@@ -79,6 +79,9 @@ ApplicationWindow {
|
||||
var newX = (bubble.x + calcRoll(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
|
||||
var newY = (bubble.y - calcPitch(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
|
||||
|
||||
if (isNaN(newX) || isNaN(newY))
|
||||
return;
|
||||
|
||||
if (newX < 0)
|
||||
newX = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user