1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-17 23:56:05 +02:00

Console fixes

This commit is contained in:
Brian Fiete 2024-07-23 11:51:47 +02:00
parent ac718dde19
commit 9209511cd7
3 changed files with 10 additions and 1 deletions

View file

@ -173,7 +173,7 @@ class ConsolePanel : Panel
{
var cellInfo = mConsolePanel.mConsoleProvider.GetCell(i);
if ((i % numVisibleCols == 0) && (i != selStart))
if ((numVisibleCols > 0) && (i % numVisibleCols == 0) && (i != selStart))
{
// Start of new line
while ((str.Length > 0) && (str[str.Length - 1] == ' '))
@ -275,6 +275,8 @@ class ConsolePanel : Panel
public static Position FromIndex(int index, int width)
{
if (width == 0)
return .((.)index, 0);
return .((.)(index % width), (.)(index / width));
}
}