I'll try to test if it works with the new wxScintilla, but I have already a workaround in mind which I am gonna try out first.
You can do other work instead - I've tried it with wxScintilla 1.69.2 -> the same problem there. Anyway: Are you sure it's caused by wxScintilla? I'd still say the calculation was wrong.
Howver, your patch works fine and makes the code more readable in addition. Good work, problem solved.

With regards, Morten.