re-calculate dynamic element width/height when resizing