This commit had had an additional not documented change: redraws
happen only when they are needed. This did not help fix the bug, but
looked smart on first sight. Alas, I find that these smart changes
added because "why not?" tend to come back to haunt me eventually.
In particular this case, the problem was that the code tested whether
the offset of anchor paragraph had changed, but not whether the
paragraph itself had changed. This means that, when switching from one
section to another with the outliner, the view was not updated.
tm.redoParagraph(bot_pit);
int const offset = coordOffset(dit).y_;
+ pit_type const old_pit = d->anchor_pit_;
d->anchor_pit_ = bot_pit;
CursorSlice const & cs = dit.innerTextSlice();
d->anchor_ypos_ = - offset + row_dim.ascent();
if (how == SCROLL_CENTER)
d->anchor_ypos_ += height_/2 - row_dim.height() / 2;
- return d->anchor_ypos_ != old_ypos;
+ return d->anchor_ypos_ != old_ypos || d->anchor_pit_ != old_pit;
}