我在这里创建一个新的二维数组。 _console.Buffer.Width 是 960,_console.Buffer.Height 是 360。但是创建的数组始终是 256、144。
glyphBuffer = new Glyph[_console.Buffer.Width, _console.Buffer.Height];
internal readonly struct Glyph
{
public readonly char Value;
public readonly int ForegroundIndex;
public readonly int BackgroundIndex;
public Glyph(char value, int foregroundIndex, int backgroundIndex)
{
Value = value;
ForegroundIndex = foregroundIndex;
BackgroundIndex = backgroundIndex;
}
}
有人知道为什么会发生这种情况吗?
我检查了断点,我 100% 确定是这种情况。
缓冲区尺寸在此过程的后期发生了变化,但数组没有变化。这就是问题所在。