UIElements top position is off

Unity Version: 2020.1.2f1
Unity UI Toolkit version: Version 1.0.0-preview.6

I am trying to absolute position my UIElement using code, but noticed that the position is off. I decided to test it manually, here are the steps I took:

  1. Calculate the world coordinates:
float height = Camera.main.orthographicSize * 2.0f;
float width = height * Screen.width / Screen.height;
Vector2 worldSize = new Vector2(width, height);
Vector3 worldPosition = new Vector3(-width / 2, 0);

Rect rect = RuntimePanelUtils.CameraTransformWorldToPanelRect(wholeWidget.panel, worldPosition, worldSize, Camera.main);
Debug.Log("rect: " + rect);

From this I got that the world height is 639.00px:

  1. I set my UI element to have an absolute position and the top to 639px. Correct me if I’m wrong, but my element should appear at the very bottom? Instead, there is some lingering space:

  1. I tried using bottom: 0px instead, and that worked as intended:

My question is, why doesn’t the top:639.00px: work correctly? I measured the size of the game screen and it was indeed 639px.

Nm, I think I may have figured it out. It was due to the scale mode of my panel