fix #35171: allow backwards lines when possible
Merge pull request #1349 from MarcSabatella/35171-backwards-line

fix #35171: allow backwards lines when possible