Resize handler to calculate margin of display area