05-06-2023, 07:52 PM
(05-06-2023, 08:23 AM)Ottia Tuota Wrote: I think now that the problem is in definitions. In post#1 it seems that with growing offset the window moves to the left. In my solution with growing 'x' the window moves to the right. So one should first set the definition of the offset once and for all and then find the exact relationship between the offset and my 'x'. (Or perhaps you already did this? It doesn't show in your post. And I'm sorry, I should have done it when I posted my solution.)
The way I thought was that 'x' is the coordinate of the left edge of the window when the origo is fixed at the left edge of some fixed line. The picture shows how I was thinking the situation:
And, overcoming my laziness, I looked at the relationship between the offset (as it is in post #1) and the 'x' in my solution. It is:
offset + x = a (= line width).
(Or you can add any fixed integer multiple of the period = line width + space width.)
So, if you want to keep using the offset in post #1, then to apply my formulas you call them with x = a-offset.