window.addEventListener resize


i am using this event listener to resize the screen when browser window is getting bigger
but its making the scene to look stretch out , how can i fix this thanks …

	window.addEventListener('resize', function()

	var width = window.innerWidth;
	var height = window.innerHeight;
	renderer.setSize( width, height );
	camera.aspect = width / height;
	} );

Can you please demonstrate the problem with a live example?

According to the following fiddle, the code seems to work: