/** * Rounds the supplied length to the nearest length value that corresponds to an integer * pixel length after the scale factor is applied. For example, for a scale factor of 3, * scale.roundToNearestPixel(8.4) = 8.33, which corresponds to exactly (8.33 * 3)= 25 pixels. */ public float roundToNearestPixel(float length) { return MathUtil.round(length * factor) / factor; }