Make text layer work when rotating page

This fixes #2095