- Home /
Question by
DaveCrowdStar · Jan 25, 2017 at 01:02 PM ·
canvasscalesizerecttransformrounding-errors
RectTransform rounding?
Been using anchors for a long time with RectTransforms. I often will expand a rect to be the same size as it's parent. I did not realize, but this process seems to round the child's size to an integer. Is there any reason for this? The CanvasScalar does not round to an integer. So my CanvasScalar on ipad was going to 1000.5 x 1334. And the child was 1001 x 1334. In the editor, when you can change the resolution more, rounding errors would really change this. Seems weird.
It would be nice to be able to just set the size and have Unity calculate the scale, but it seems linked to the Camera. Any answers?
Comment
Also of note, sometimes it rounds down and leaves an empty pixel on the side.
Your answer
![](https://koobas.hobune.stream/wayback/20220612105533im_/https://answers.unity.com/themes/thub/images/avi.jpg)