Added a check for empty scrollbar range.
This commit is contained in:
parent
d5749b454d
commit
cdbab8bcfd
@ -310,6 +310,7 @@ void ME_UpdateScrollBar(ME_TextEditor *editor, int ypos)
|
|||||||
GetScrollInfo(hWnd, SB_VERT, &si);
|
GetScrollInfo(hWnd, SB_VERT, &si);
|
||||||
|
|
||||||
if (ypos < 0) {
|
if (ypos < 0) {
|
||||||
|
if (si.nMax<1) si.nMax = 1;
|
||||||
perc = 1.0*si.nPos/si.nMax;
|
perc = 1.0*si.nPos/si.nMax;
|
||||||
ypos = perc*overflow;
|
ypos = perc*overflow;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user