Line spacing is not constant
Lebostein
Member Posts: 19
The line spacing between two lines of text is changing +/-1 Pixel during scrolling the text! In other words: the line spacing depends on the scroll position. I think this is a wrong calculation from float text positions to the integer based pixel positions. I see this very clearly on my low-res MacBook with 1280x800 Pixel display. Looks awful If some lines of an huge text block jumping up and down during scrolling....
I hope you can fix this easy.
I hope you can fix this easy.
0
Comments
It is a bug. If you output a graphic (a letter of a bitmap font in this case) and the position of this letter is calculated by float coordinates, then you have to round up or round down this coordinate to an integer pixel value. And if you calculate every line of a text by its own coordinate, then some y-positions are rounded up, some rounded down. It depends on the scroll position.
The right way ist to calculate a fixed pixel-offset, that is used for every line to the next line. Then every line have the same spacing to the next.
For monitor resolutions grater then 800 pixel in y it will not be noticeable so much. But here with 800 pixel in y it disturbs me...
If you add the float scroll position with the float text line offset and round the solution of this addition to a pixel coordinate, then you get this effect.
The easiest way to fix this is to round the scrolling position to an integer BEFORE you add the offset of the text line. Then the spacing between two lines is independent of the scroll position...