Fix updating of the scroll bar after opening a new file.

Originally committed to SVN as r4726.
This commit is contained in:
Thomas Goyne 2010-08-03 20:21:13 +00:00
parent f66ef36f93
commit 11d67ec6ae
1 changed files with 2 additions and 3 deletions

View File

@ -946,7 +946,6 @@ void BaseGrid::AdjustScrollbar() {
int drawPerScreen = h/lineHeight;
int rows = GetRows();
bool barToEnable = drawPerScreen < rows+2;
bool barEnabled = scrollBar->IsEnabled();
yPos = MID(0,yPos,rows - drawPerScreen);
@ -954,10 +953,10 @@ void BaseGrid::AdjustScrollbar() {
scrollBar->GetSize(&sw,&sh);
scrollBar->SetSize(w-sw,0,sw,h);
if (barEnabled) {
if (barToEnable != scrollBar->IsEnabled()) scrollBar->Enable(barToEnable);
if (barToEnable) {
scrollBar->SetScrollbar(yPos,drawPerScreen,rows+2,drawPerScreen-2,true);
}
if (barToEnable != barEnabled) scrollBar->Enable(barToEnable);
scrollBar->Thaw();
}