(svn r20223) -Codechange: Replace scrolled row calculations by a call to GetScrolledRowFromWidget().

This commit is contained in:
alberth
2010-07-26 13:08:48 +00:00
parent 6734f083b0
commit a50578c3ad
19 changed files with 58 additions and 134 deletions

View File

@@ -1014,7 +1014,7 @@ struct MessageHistoryWindow : Window {
NewsItem *ni = _latest_news;
if (ni == NULL) return;
for (int n = (pt.y - this->GetWidget<NWidgetBase>(MHW_BACKGROUND)->pos_y - WD_FRAMERECT_TOP) / this->line_height + this->vscroll.GetPosition(); n > 0; n--) {
for (int n = this->vscroll.GetScrolledRowFromWidget(pt.y, this, MHW_BACKGROUND, WD_FRAMERECT_TOP, this->line_height); n > 0; n--) {
ni = ni->prev;
if (ni == NULL) return;
}