On Sun, Sep 16, 2007 at 04:27:04AM +0200, Tommaso Cucinotta wrote: > Hi, > > I couldn't really understand what information is > stored inside the BufferView.offset_ref_ variable. > At a first glance, it would seem that anchor_ref_ > stores the "paragraph offset" that is displayed from > the WorkArea top line, and offset_ref_ stores the > "pixel offset". Namely, the top WorkArea line of > pixels would display the offset_ref_-th line of > the anchor_ref_-th paragraph.
Almost right. IIRC anchor_ref_ represents the top visible paragraph, and offset_ref_ the offset, in pixels, of the cursor position (which may be in a later paragraph). "Normalization" means making the cursor paragraph the top one on-screen. > Even if I keep these two values in sync with the scrollbar, > it seems there are other variables that decide what pars > the workarea starts displaying from the top. Yes. > Moreover, what var decides how the gray text background > is cut at the end of the doc ? Yes, that is tricky. It's years ago that I looked at this :-( I suspect it is in GuiWorkArea::setScrollbarParams(): // do what cursor movement does (some grey) h += height() / 4; > Thanx, > > T. - Martin