Fix vertical scrollbar visibility in wxStyledTextCtrl
Vertical scrollbar didn't appear even when the number of lines in the control became one greater than the maximal fitting number of lines, but only when one more line was added. This seems to have been a simple off-by-one error in SetScrollbar() calls, so fix this by adding 1 to the upper end of the range. Closes #17548.
This commit is contained in:
parent
152b9fc0eb
commit
beaca78962
@ -79,6 +79,7 @@ All (GUI):
|
||||
- Add support for wxAuiManager and wxAuiPaneInfo to XRC (Andrea Zanellato).
|
||||
- Add support for wxSL_MIN_MAX_LABELS and wxSL_VALUE_LABEL to XRC (ousnius).
|
||||
- Update Scintilla to v3.6.6 (Paul Kulchenko).
|
||||
- Fix vertical scrollbar visibility in wxStyledTextCtrl (yenwu, NewPagodi).
|
||||
- Fix bug with not being able to select AUI tab after dragging.
|
||||
- Make wxDataViewCtrl::Expand() expand ancestors in native ports too.
|
||||
- Add wxDataViewCtrl::SetHeaderAttr().
|
||||
|
@ -421,7 +421,7 @@ const int H_SCROLL_STEP = 20;
|
||||
bool ScintillaWX::ModifyScrollBars(int nMax, int nPage) {
|
||||
bool modified = false;
|
||||
|
||||
int vertEnd = nMax;
|
||||
int vertEnd = nMax+1;
|
||||
if (!verticalScrollBarVisible)
|
||||
vertEnd = 0;
|
||||
|
||||
@ -431,7 +431,7 @@ bool ScintillaWX::ModifyScrollBars(int nMax, int nPage) {
|
||||
int sbThumb = stc->GetScrollThumb(wxVERTICAL);
|
||||
int sbPos = stc->GetScrollPos(wxVERTICAL);
|
||||
if (sbMax != vertEnd || sbThumb != nPage) {
|
||||
stc->SetScrollbar(wxVERTICAL, sbPos, nPage, vertEnd+1);
|
||||
stc->SetScrollbar(wxVERTICAL, sbPos, nPage, vertEnd);
|
||||
modified = true;
|
||||
}
|
||||
}
|
||||
@ -440,7 +440,7 @@ bool ScintillaWX::ModifyScrollBars(int nMax, int nPage) {
|
||||
int sbPage = stc->m_vScrollBar->GetPageSize();
|
||||
int sbPos = stc->m_vScrollBar->GetThumbPosition();
|
||||
if (sbMax != vertEnd || sbPage != nPage) {
|
||||
stc->m_vScrollBar->SetScrollbar(sbPos, nPage, vertEnd+1, nPage);
|
||||
stc->m_vScrollBar->SetScrollbar(sbPos, nPage, vertEnd, nPage);
|
||||
modified = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user