public void scaleToFit ( float fitWidth , float fitHeight ) { scalePercent ( 100 ) ; float percentX = ( fitWidth * 100 ) / getScaledWidth ( ) ; float percentY = ( fitHeight * 100 ) / getScaledHeight ( ) ; scalePercent ( percentX < percentY ? percentX : percentY ) ; setWidthPercentage ( 0 ) ; }
Scales the image so that it fits a certain width and height .