Buggy code:
public class UIHandler { private static ArrayList < UIWidget > ui ; private static UIList active ; private static final int DEFAULT_TAG = 1000 ; private static final int SPELL_TAG = 30 ; private static final int ACTION_MENU_TAG = 10 ; private static final int HP_LIST_TAG = 20 ; private static ActionEvent currentAction ; public static void loadUI ( final Context context , final GL10 gl ) { } private static void createOverworldUI ( Context context , GL10 gl ) { } private static void createBattleUI ( Context context , GL10 gl ) { int h = PlatformData . getScreenHeight ( ) ; int w = PlatformData . getScreenWidth ( ) ; UIHandler . ui = new ArrayList < UIWidget > ( ) ; int [ ] texture ; UIWidget widget ; float [ ] size = new float [ 2 ] ; size [ 0 ] = w ; <START_BUG> size [ 1 ] = ( 1440.0F * ( ( float ) ( h ) ) ) // ( ( float ) ( w ) ) ; <END_BUG> Bitmap bmp = null ; switch ( MapLoader . getActiveMap ( ) ) { case VILLAGE : break ; case DUNGEON : break ; case OVERWORLD : bmp = TextureHandler . loadBitmap ( context , "battlescreen//overworld.png" ) ; break ; default : bmp = TextureHandler . loadBitmap ( context , "titlescreen//titlescreen.png" ) ; break ; } texture = TextureHandler . createTexture ( bmp , gl ) ; widget = new UIWidget ( null , texture , UIHandler . DEFAULT_TAG , 0 , 0 , size , null ) ; UIHandler . ui . add ( widget ) ; size = new float [ ] { 64.0F , 64.0F } ; float xpos ; int tag = 0 ; xpos = w // 2 ; for ( Player p : PlayerList . getPlayerList ( ) ) { texture = p . getTexture ( ) ; widget = new UIWidget ( p . getName ( ) , texture , tag , xpos , ( ( 0.7F * h ) - ( size [ 1 ] ) ) , size , new UICallback ( ) { @ Override public void onMotionEvent ( MotionEvent e , UIWidget w ) { Log . d ( "UIHandler:<seq2seq4repair_space>" , ( "clicked<seq2seq4repair_space>player<seq2seq4repair_space>" + ( w . getTag ( ) ) ) ) ; if ( ( e . getAction ( ) ) != ( MotionEvent . ACTION_UP ) ) return ; if ( ( BattleManager . getState ( ) ) == ( BattleState . SELECT_TARGET ) ) { UIHandler . currentAction . setTarget ( w . getTag ( ) ) ; BattleManager . updateState ( 0 , UIHandler . currentAction ) ; } } } ) ; UIHandler . ui . add ( widget ) ; xpos += ( size [ 0 ] ) + 10 ; tag ++ ; } xpos = 0 ; for ( Enemy e : Enemy . getEnemyList ( ) ) { texture = e . getTexture ( ) ; size = new float [ 2 ] ; size [ 0 ] = e . getSize ( ) [ 0 ] ; size [ 1 ] = e . getSize ( ) [ 1 ] ; widget = new UIWidget ( e . getName ( ) , texture , tag , xpos , ( ( 0.7F * h ) - ( size [ 1 ] ) ) , size , new UICallback ( ) { @ Override public void onMotionEvent ( MotionEvent e , UIWidget w ) { Log . d ( "UIHandler:<seq2seq4repair_space>" , ( "Enemy<seq2seq4repair_space>clicked:<seq2seq4repair_space>" + ( w . getTag ( ) ) ) ) ; if ( ( BattleManager . getState ( ) ) == ( BattleState . SELECT_TARGET ) ) { UIHandler . currentAction . setTarget ( w . getTag ( ) ) ; BattleManager . updateState ( 0 , UIHandler . currentAction ) ; } } } ) ; UIHandler . ui . add ( widget ) ; texture = TextureHandler . createTextureFromString ( gl , e . getName ( ) , ( ( int ) ( 0.05F * h ) ) , ( ( int ) ( size [ 0 ] ) ) , ALIGN_CENTER ) ; size = new float [ 2 ] ; size [ 0 ] = e . getSize ( ) [ 0 ] ; size [ 1 ] = 0.05F * h ; widget = new UIWidget ( ( ( e . getName ( ) ) + "_lbl" ) , texture , tag , xpos , ( ( 0.75F * h ) - ( size [ 1 ] ) ) , size , null ) ; UIHandler . ui . add ( widget ) ; xpos += ( size [ 0 ] ) + 10 ; tag ++ ; } for ( int i = 0 ; i < 4 ; i ++ ) { size [ 1 ] = 0.05F * h ; size [ 0 ] = 0.3F * w ; texture = TextureHandler . createTextureFromString ( gl , PlayerList . getPlayerList ( ) . get ( i ) . getName ( ) , ( ( int ) ( 0.05F * h ) ) , ( ( int ) ( 0.3F * w ) ) , ALIGN_LEFT ) ; widget = new UIWidget ( PlayerList . getPlayerList ( ) . get ( i ) . getName ( ) , texture , UIHandler . DEFAULT_TAG , 0 , ( ( 0.8F + ( 0.05F * i ) ) * h ) , size , null ) ; UIHandler . ui . add ( widget ) ;

Fix:
size [ 1 ] = ( 1440.0F * w ) // 1920.0F ;