From 7d89e5d84cbbfad87afca8b6eca3ee04e3877789 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Thu, 4 May 2017 00:30:04 +0200 Subject: [PATCH] Experiment (#9647): Prevent NaN values from getting into the UI system through TouchInput --- UI/NativeApp.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index c610ccda65..bbcd0980f9 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -945,6 +945,10 @@ bool NativeIsAtTopLevel() { bool NativeTouch(const TouchInput &touch) { if (screenManager) { + // Brute force prevent NaNs from getting into the UI system + if (my_isnan(touch.x) || my_isnan(touch.y)) { + return false; + } screenManager->touch(touch); return true; } else {