A linear algorithm for compact box-drawings of trees