draw background, handle resize event