getWidth and getHeight just once