Bug report: T58216
I am not very familiar with drawing code, so this patch is probably bad. I was looking at commit history, why this stopped working, but found nothing.
Can I have a rough guidance how to do this properly?
Also in the similar spirit there is task T59951 (tl;dr view centering not considering side panel)
I have not looked into this, probably would look at ARegion settings, but other than that no idea.