Made the width of the canvas vary depending on the width of its bounding box