mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
Fix console scrolling too far when page scrolling with scaled text
This commit is contained in:
parent
4dce07762b
commit
c5eb28d360
1 changed files with 3 additions and 4 deletions
|
@ -100,7 +100,7 @@ extern bool advancedemo;
|
||||||
extern FBaseCVar *CVars;
|
extern FBaseCVar *CVars;
|
||||||
extern FConsoleCommand *Commands[FConsoleCommand::HASH_SIZE];
|
extern FConsoleCommand *Commands[FConsoleCommand::HASH_SIZE];
|
||||||
|
|
||||||
unsigned ConCols, PhysRows;
|
unsigned ConCols;
|
||||||
int ConWidth;
|
int ConWidth;
|
||||||
bool vidactive = false;
|
bool vidactive = false;
|
||||||
bool cursoron = false;
|
bool cursoron = false;
|
||||||
|
@ -533,7 +533,6 @@ void C_InitConsole (int width, int height, bool ingame)
|
||||||
}
|
}
|
||||||
ConWidth = (width - LEFTMARGIN - RIGHTMARGIN);
|
ConWidth = (width - LEFTMARGIN - RIGHTMARGIN);
|
||||||
ConCols = ConWidth / cwidth;
|
ConCols = ConWidth / cwidth;
|
||||||
PhysRows = height / cheight;
|
|
||||||
|
|
||||||
if (conbuffer == NULL) conbuffer = new FConsoleBuffer;
|
if (conbuffer == NULL) conbuffer = new FConsoleBuffer;
|
||||||
}
|
}
|
||||||
|
@ -1324,7 +1323,7 @@ static bool C_HandleKey (event_t *ev, FCommandBuffer &buffer)
|
||||||
case GK_PGUP:
|
case GK_PGUP:
|
||||||
if (ev->data3 & (GKM_SHIFT|GKM_CTRL))
|
if (ev->data3 & (GKM_SHIFT|GKM_CTRL))
|
||||||
{ // Scroll console buffer up one page
|
{ // Scroll console buffer up one page
|
||||||
RowAdjust += (SCREENHEIGHT-4) /
|
RowAdjust += (SCREENHEIGHT-4)/active_con_scale() /
|
||||||
((gamestate == GS_FULLCONSOLE || gamestate == GS_STARTUP) ? ConFont->GetHeight() : ConFont->GetHeight()*2) - 3;
|
((gamestate == GS_FULLCONSOLE || gamestate == GS_STARTUP) ? ConFont->GetHeight() : ConFont->GetHeight()*2) - 3;
|
||||||
}
|
}
|
||||||
else if (RowAdjust < conbuffer->GetFormattedLineCount())
|
else if (RowAdjust < conbuffer->GetFormattedLineCount())
|
||||||
|
@ -1347,7 +1346,7 @@ static bool C_HandleKey (event_t *ev, FCommandBuffer &buffer)
|
||||||
case GK_PGDN:
|
case GK_PGDN:
|
||||||
if (ev->data3 & (GKM_SHIFT|GKM_CTRL))
|
if (ev->data3 & (GKM_SHIFT|GKM_CTRL))
|
||||||
{ // Scroll console buffer down one page
|
{ // Scroll console buffer down one page
|
||||||
const int scrollamt = (SCREENHEIGHT-4) /
|
const int scrollamt = (SCREENHEIGHT-4)/active_con_scale() /
|
||||||
((gamestate == GS_FULLCONSOLE || gamestate == GS_STARTUP) ? ConFont->GetHeight() : ConFont->GetHeight()*2) - 3;
|
((gamestate == GS_FULLCONSOLE || gamestate == GS_STARTUP) ? ConFont->GetHeight() : ConFont->GetHeight()*2) - 3;
|
||||||
if (RowAdjust < scrollamt)
|
if (RowAdjust < scrollamt)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue