Merge branch 'frankiezafe-dev' into dev-2.2.7

quick fix on ListBox:onRelease index out of range error
This commit is contained in:
andreas schlegel 2018-09-22 10:03:16 +08:00
commit fa0aacdfd1
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 );