Weird rendering issue on phones with a notch

I’m editing this post completely. Originally it was about my transform matrix not rendering properly on tall resolutions. However, I have since realised that it wasn’t my transform matrix at all.

Here’s a screenshot of how my game is rendered. It is just a simple SpriteBatch.Draw() at 0, 0 using a 1920x1080 image on a 2340x1080 screen. I have removed the top and bottom bars with immersive mode, which is working fine. However, for whatever reason, the game is not rendering all the way left, and the same distance is being cut off on the right. This area can change using GraphicsDevice.Clear(), but not SpriteBatch.Draw(), even when I’m drawing at a negative x coordinate. I’ve tested on both a P30 Pro and a Oneplus 6, both have the exact same issue.

If anyone has any idea what is going on here I would love to hear it, I have spent quite a while trying to fix it and nothing has worked. If there is a way to detect these weird boundaries so that I can scale the image inside them, I would be interested in hearing that as well.

Thanks in advance,

No idea if this will solve it but it looks like a weird problem i had before that made me scratch my head for days except it was happening on a depth buffer. Looks like a sampler state problem.

Try setting the sampler states AddressU and AddressV to Border.

public static SamplerState SS_PointBorder = new SamplerState() { Filter = TextureFilter.Point, FilterMode = TextureFilterMode.Comparison, AddressU = TextureAddressMode.Border, AddressV = TextureAddressMode.Border };