when window resized, also updates width.