2D setting the width of a sliced sprite to match the screen width

Hi,

I’m making a SpriteRenderer fit to the width of (portrait) mobile screen. To do this I translate the screen width & height to world coordinates (im using an orthographic camera), like this:

var screenTopRight = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height, 0));

this gives me in my case (5.63,10,0). The size of the camera is 10 (I expected the actual screen height to be 20 as the orthographic size should be ‘half the size of the vertical viewing volume’?)

Anyway, if I want my (sliced) panel sprite to be the same width as the screen and 1/5 of the height, I have to set the size like this (no scaling transform since this is a 9-slice)

var panelSprite = gameObject.GetComponent<SpriteRenderer>();
panelSprite.size = new Vector2(screenTopRight.x * 2, screenTopRight.y * 2 / 5);

Why do I have to set the width of the sprite to twice the screen width in world coordinates?

Thanks