private void calculateMinimapBounds ( ) { float ratioX = Constants . MINIMAP_MAX_SIZE / optimalPageWidth ; float ratioY = Constants . MINIMAP_MAX_SIZE / optimalPageHeight ; float ratio = Math . min ( ratioX , ratioY ) ; float minimapWidth = optimalPageWidth * ratio ; float minimapHeight = optimalPageHeight * ratio ; minimapBounds = new RectF ( getWidth ( ) - 5 - minimapWidth , 5 , getWidth ( ) - 5 , 5 + minimapHeight ) ; calculateMinimapAreaBounds ( ) ; }
Place the minimap background considering the optimal width and height and the MINIMAP_MAX_SIZE .