Scrollview mask 2 pixels too small

I am trying too align a vertical scroll view content with other content outside the scroll view, but left side of my content is missing, hidden by the mask for about 2 pixels. I am using the default Unity UI Scroll View

In the following image, the same corner image is in the top left corner in blue, outside the scroll view, and the same image in red is inside the scrollview. The red one is perfectly on top of the blue one, but the 2 leftmost and upmost pixels are masked, showing the blue one

Does anyone know how to correct this ?

unity sourcemask and background sliced images have a bit of rounding on them…
i usually remove images from panels etc… (or maybe could create own sliced image, without rounded borders)

1 Like

Thanks, its works !

If anyone got the problem, add the following script to your scroll view

void Start()
{
Image mask = transform.FindChild(“Viewport”).GetComponent();
mask.sprite = Sprite.Create(new Texture2D(1, 1), new Rect(0, 0, 1, 1), new Vector2(0, 0));
}