Skip to content

Commit

Permalink
fix - reg - Fixed glitched centering
Browse files Browse the repository at this point in the history
---

We've fixed a regression regarding the positional writer where it would wrongly assume that we need to wrap when this is not the case.

---

Type: fix
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Jul 13, 2024
1 parent 7d977aa commit 17c30a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Terminaux/Writer/ConsoleWriters/TextWriterWhereColor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -392,15 +392,15 @@ internal static string RenderWhere(string msg, int Left, int Top, bool Return, i
int vtSeqIdx = 0;

// Now, parse every character
int pos = OldLeft;
int pos = Left;
for (int i = 0; i < MessageParagraph.Length; i++)
{
// If there is a new line, or if we're about to hit the maximum width, we need to go down
if (MessageParagraph[i] == '\n' || RightMargin > 0 && pos > width)
{
buffered.Append($"{CharManager.GetEsc()}[1B");
buffered.Append($"{CharManager.GetEsc()}[{Left + 1}G");
pos = OldLeft;
pos = Left;
}

// Write a character individually
Expand All @@ -418,7 +418,7 @@ internal static string RenderWhere(string msg, int Left, int Top, bool Return, i
{
buffered.Append($"{CharManager.GetEsc()}[1B");
buffered.Append($"{CharManager.GetEsc()}[{Left + 1}G");
pos = OldLeft;
pos = Left;
}
}

Expand Down

0 comments on commit 17c30a3

Please sign in to comment.