At 08:05 PM 1/18/00 -0800, Kirill 'Big K' Katsnelson wrote:
First of all, I want to point that the change which introduced
window-pixel-scroll-increment was *not* a bug, it revealed a bug
too. Without this change, the same effects show if the default face
font is much shorter than the font used for current display lines.
Well I did all the pixel scrolling code - so I should be able to answer
your question although I'm not sure I can.
Set window-pixel-scroll-increment to 1. When scrolling down using
scrollbar arrow, display moves smoothly, jumping over line descents.
This jumping is perhaps correct, so window display cannot start in a
middle of inter-line spacing.
The jumping is due to the fact that the redisplay code only allows you to
clip the ascent not the descent. It might not be hard to change this but
I'm not sure it is worth the bother.
When scrolling up, scroll goes smoothly only before the top of the
partially obscured top line hits the window top. Since then,
scrolling switches back to per-line scroll. I added code which fixes
it, but it loses. It is #if0'ed now, and I would be grateful if
someone can suggest me how to fix it. This is a problem #1.
Scrolling up is a pain as you point out in your comment. Pixel scrolling
relies on redisplay to calculate line dimensions, when you scroll up you
don't know what the height of the next line is going to be so you lose.
However, your code is almost correct if you guess that the new line is
going to be the same height as the current one. In this instance you can
generate a reasonable top clip. I have fixed this and applied it.
The problem #2 manifests itself when a top line is clipped. It
remains clipped when a) buffers are switched in a window, b) when
window is scrolled by way of regenerating it. I tried to find
all places in regenerate where it should be reset, but it appears
too deep in regenerate when the decision should be made to reset
top clipping, so effectively regenerate should be restarted.
What about hooking it into something like INVALIDATE_PIXEL_TO_GLYPH_CACHE
or invalidate_current_column() ?
As a solution, I want to introduce a window flag which tells
regenerate *not* to reset clipping even if buffer has moved
in the window vertically. If not set, regenrate_window will
reset clipping. I do not feel this being an elegant solution
though: regenerate is idempotent, so that it can be applied to a
window many times with the same result; it stops being such when
it depends on a flag which it resets by itself. I'd appreciate
comments on that.
As you say not elegant, but maybe a solution.
andy
--------------------------------------------------------------
Dr Andy Piper
Senior Consultant Architect, BEA Systems Ltd