This commit is contained in:
frankiezafe 2018-06-11 09:59:36 +00:00 committed by GitHub
commit 8df320f676
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -128,9 +128,14 @@ public class ListBox extends Controller< ListBox > implements ControlListener {
} else if ( isOpen ) {
double n = Math.floor( ( getPointer( ).y( ) - barHeight ) / itemHeight );
// n += itemRange; /* UP */
int index = ( int ) n + itemIndexOffset;
if ( index < 0 || index >= items.size() ) {
// no need to go further, there is something wrong in the position process
return;
}
Map m = items.get( index );