- Fix: Crash when scroll file which has more than 65535 lines.

This commit is contained in:
Roy Qu 2022-12-14 09:12:37 +08:00
parent 02e6748db5
commit 4093f29ac4
2 changed files with 3 additions and 2 deletions

View File

@ -19,6 +19,7 @@ Red Panda C++ Version 2.6
- enhancement: Auto disable "compile" button if gcc doesn't exist.
- enhancement: Auto disable "debug" button if gdb doesn't exist.
- enhancement: Auto disable "compile" button for project if make doesn't exist.
- Fix: Crash when scroll file which has more than 65535 lines.
Red Panda C++ Version 2.5

View File

@ -3244,7 +3244,7 @@ void SynEdit::updateScrollbars()
nPage = mCharsInWindow;
nPos = mLeftChar;
} else {
nMin = 0;
nMin = 1;
nMax = MAX_SCROLL;
nPage = mulDiv(MAX_SCROLL, mCharsInWindow, nMaxScroll);
nPos = mulDiv(MAX_SCROLL, mLeftChar, nMaxScroll);
@ -3265,7 +3265,7 @@ void SynEdit::updateScrollbars()
nPage = mLinesInWindow;
nPos = mTopLine;
} else {
nMin = 0;
nMin = 1;
nMax = MAX_SCROLL;
nPage = mulDiv(MAX_SCROLL, mLinesInWindow, nMaxScroll);
nPos = mulDiv(MAX_SCROLL, mTopLine, nMaxScroll);