Image not correctly scaling with rect transform
Hello,
So, I am creating a game that is using a grid of pixels. Currently, this is done using a GridLayoutGroup that contains many GameObjects. Each of those GameObjects has an Image component that shows the wanted "pixel" image. Since this is a mobile game, i decided to change the cellSize of the GridLayoutGroup depending on the resolution of the device.
What i have noticed, is when I'm trying to change a RectTransform's Width and Height it does not scale the contained Image to fit exactly the width and height. It changes the image's size every some offset. Somewhat like snapping?
Going back to the GridLayoutGroup, some resolutions will change cellSize to something like (19.26976, 16.1866), which as explained above will have this result:
That leads to some very weird positioning and scaling of the images, the more items there are inside the GridLayoutGroup.
Is there a way to make images perfectly scalable to fit the borders of the RectTransform?
Any help is appreciated.