From e3bd896a9a02cdbf9cff53c9ecaa6ba903f2371c Mon Sep 17 00:00:00 2001 From: Berstanio Date: Sun, 22 Oct 2023 19:05:16 +0200 Subject: [PATCH] fix(android): Guard against negative DropwDownHeight --- .../com/badlogic/gdx/backends/android/DefaultAndroidInput.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/DefaultAndroidInput.java b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/DefaultAndroidInput.java index 08f2ca3104e..a65b2caddfd 100644 --- a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/DefaultAndroidInput.java +++ b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/DefaultAndroidInput.java @@ -770,7 +770,8 @@ public void showDropDown () { int size = 165 * count; if (size > relativeLayout.getHeight() + relativeLayout.getY() - getHeight()) size = (int)(relativeLayout.getHeight() + relativeLayout.getY() - getHeight()); - if (size != 0) setDropDownHeight(size); + if (size > 0) + setDropDownHeight(size); setDropDownVerticalOffset(-getDropDownHeight() - getHeight()); setDropDownWidth((int)(getWidth() * relativeLayout.getScaleX())); super.showDropDown();