Fixed wrong distance calculation for Swing animation