fix(kernel/tty): wrong calculation of cell index

Instead of ws_row, now it's ws_col.
This commit is contained in:
EnderIce2 2025-04-17 15:56:16 +00:00
parent abb7899a9d
commit 7902726239
Signed by: enderice2
GPG Key ID: FEB6B8A8507BA62E

View File

@ -123,7 +123,8 @@ namespace KernelConsole
ConsoleTerminal *term = CurrentTerminal.load();
ConsoleTerminal::Blinker &blinker = term->Blink;
TerminalCell *cell = term->Term->GetCell(Renderer.Cursor.X + Renderer.Cursor.Y * term->Term->GetWinsize()->ws_row);
size_t cellIndex = Renderer.Cursor.Y * term->Term->GetWinsize()->ws_col + Renderer.Cursor.X;
TerminalCell *cell = term->Term->GetCell(cellIndex);
uint32_t bgColor = cell->attr.Bright ? TermBrightColors[cell->attr.Background] : TermColors[cell->attr.Background];
Renderer.Paint(Renderer.Cursor.X, Renderer.Cursor.Y, blinker.Character, Enable ? blinker.Color : bgColor, bgColor);
}