Correctly redraw canvas on window resize