Fixed resize probem with offscreen rendering