Fix scale issue when orientation changes

Attached, screenshots of the issue.

Please note that it can be reproduced on Linux and Mac. And it has been tested so far on three machines.