Changing anchored Position

I have a chat box where I want to expand its size.
In the past if i wanted to expand it in height by say 300 units
All i had to do is change the sizeDelta to current position + 300 / 2 or height / 2 and that would keep the chat in place.

For some reason today it doesn’t do this. 300/2 moves the chat box up way to far.

Anyone have any ideas.

it is probably because of your anchors… (however, your math doesn’t really make sense)
how are the anchor values?
I always prefer to have the anchors on the borders so that the size delta and anchored position are at zero. That way you could simply change the anchor values to resize it (however, they are relative coordinates)…

You’ve got to pay attention to your anchors and your pivot when repositioning objects from script.

pivot is only important under certain circumstances. 90% of the times it doesn’t really matter. However, you are right that the pivot also might be important. But usually you don’t want to change it via code again.