Occasional drawing bug.

Posted by Worstje on Sun 19 Oct 2008 02:45 PM — 4 posts, 11,444 views.

Netherlands #0
I have only noticed this bug since TextRectangle() being added, after the 'drawing a line too much' bug was fixed. It seems like a strange off-by-one-pixel kind of error which only happens when using PageUp and PageDown.

I press PageUp once, and the bottom (last received) line disappears. Upon close inspection, it looks as if the second-to-last line dropped exactly one pixel. I press PageUp again, it drops one pixel more. Etc etc.

I can see the effect very well by keeping PageUp pressed, since the last line will fall away, and everything will slowly converge to the bottom-most position again. Once the second-to-last line would start to clip beneath the bottom (like the previous last line had) that too will fall away, and the line will fall away again.

Basically, the drawing code somewhere fails to properly calculate what line properly falls into view, which manages to manifest due to the pageup/pagedown keys not scrolling a precise page/using a different method to actually scroll than using a mousewheel or the scrollbarARROWS. Dragging the thumbnail or clicking in the empty space above or below the thumb will also show it, including the saw-effect described above if you keep it clicked down.

I can provide a few screenshots if needed, but they don't really saw much on themselves.
Australia Forum Administrator #1
Whilst I can believe that the drawing routine might miscalculate the number of lines on some edge condition based on the exact size of the drawing rectangle, the font size, and the pixel offset, so far I haven't reproduced it drawing a partial line.

Basically the calculation in question works out how many lines to draw, not pixels. Once it is committed to drawing a line, it should appear in full. I no longer use clipping rectangles (or don't think I do), so the text should not be clipped.
Netherlands #2
It isn't being clipped at all, Nick. The problem is that all lines shift up or down a pixel per pageup/pagedown. Once shifted compared to a 'default' position, the last visible lime disappears completely, leaving a strange gap at the bottom. I'll see if I can get my hands on some screenrecording software later today so the problem becomes more clear.
Australia Forum Administrator #3
Ah I see, I misunderstood slightly. To help me reproduce it, can you give me the dimensions of the rectangle you are using, the number of pixels offset as defined in the output configuration, and the font and size you are using?