vScrollInfo.fMask = SIF_ALL;
self.GetScrollInfo(SB_VERT,&vScrollInfo);
- if(!(cursel >= vScrollInfo.nPos && cursel < vScrollInfo.nPos + static_cast<INT_PTR>(vScrollInfo.nPage))){
+ if(!(cursel >= vScrollInfo.nPos && cursel <= vScrollInfo.nPos + static_cast<INT_PTR>(vScrollInfo.nPage) / 2)){
self.SetScrollPos(SB_VERT,cursel - (vScrollInfo.nPage / 2));
}
dy += self.commentlist.GetCurSel();
- if(dy < 0 || dy > static_cast<INT_PTR>(self.commentlist.Size()))goto end;
+ if(dy < 0 || dy >= static_cast<INT_PTR>(self.commentlist.Size()))goto end;
self.commentlist.SetCurSel(dy);