UI Toolkit Canvas Size and Game Canvas Size is not Matching

I’m having a problem where my game view size is different than the UI Toolkit Editor Canvas Size. I don’t know why is this happening.

In the panel settings I set the scale mode to Scale with screen size and Match to 0.5.
And I set the Canvas Size to match the game view, and Canvas Background to Camera and set it to the Main Camera. Am I missing something?

The UI Builder does not currently support custom panel settings. So anything you set in the PanelSettings will be ignored in the preview.

I fixed this issue. Instead of setting the game resolution to a ratio like 18:9, 16:9, I set it to 1080x1920 matching the panel settings, and it worked fine now.