- if (recenter)
- d->anchor_ypos_ = height_/2;
- else if (d->anchor_pit_ == 0)
- d->anchor_ypos_ = offset + pm.ascent();
- else if (d->anchor_pit_ == max_pit)
- d->anchor_ypos_ = height_ - offset - row_dim.descent();
- else if (offset > height_)
- d->anchor_ypos_ = height_ - offset - row_dim.descent();
- else
- d->anchor_ypos_ = row_dim.ascent();
-
- return true;
+ int const old_ypos = d->anchor_ypos_;
+ 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 || d->anchor_pit_ != old_pit;