mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 18:02:16 +00:00
slightly fix caret movement and wrapping
This commit is contained in:
parent
d5a47f546f
commit
c832b78308
1 changed files with 10 additions and 4 deletions
|
@ -183,11 +183,17 @@ namespace ShiftOS.Frontend.Apps
|
|||
var font = new Font(LoadedSkin.TerminalFont.Name, LoadedSkin.TerminalFont.Size * _zoomFactor, LoadedSkin.TerminalFont.Style);
|
||||
int currline = GetCurrentLine();
|
||||
string substring = String.Join(Environment.NewLine, Lines.Take(currline + 1));
|
||||
int h = (int)Math.Round(gfx.SmartMeasureString(substring, font).Height - font.Height);
|
||||
var lineMeasure = gfx.SmartMeasureString(Lines[currline], font);
|
||||
int h = (int)Math.Round(gfx.SmartMeasureString(substring, font, Width).Height - font.Height);
|
||||
|
||||
int linestart = String.Join(Environment.NewLine, Lines.Take(GetCurrentLine())).Length;
|
||||
|
||||
var lineMeasure = gfx.SmartMeasureString(Text.Substring(linestart, Index - linestart), font);
|
||||
int w = (int)Math.Floor(lineMeasure.Width);
|
||||
if (w > Width - 4)
|
||||
w = Width - 4;
|
||||
while (w > Width)
|
||||
{
|
||||
w -= Width;
|
||||
h += (int)lineMeasure.Height;
|
||||
}
|
||||
return new System.Drawing.Point(w, h);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue