This commit is contained in:
@@ -878,9 +878,10 @@ namespace Volian.Print.Library
|
||||
private List<string> SplitText(string text, int len)
|
||||
{
|
||||
List<string> results = new List<string>();
|
||||
int width = 0;
|
||||
int start = 0;
|
||||
int lastspace = 0;
|
||||
int width = 0; // width of text, non-rtf
|
||||
int start = 0; // start of line (index into string 'text'), includes rtf
|
||||
int lastspace = 0; // location of lastspace (index into string 'text'), includes rtf
|
||||
int startNonRtf = 0; // start of line, non-rtf (used for determining starting position to determine width if there was a break)
|
||||
string rtfprefix = "";
|
||||
string nextprefix = "";
|
||||
for (int indx = 0; indx < text.Length; indx++)
|
||||
@@ -919,6 +920,7 @@ namespace Volian.Print.Library
|
||||
if (text[indx] == ' ')
|
||||
{
|
||||
lastspace = indx;
|
||||
startNonRtf = width;
|
||||
}
|
||||
width++;
|
||||
if (width > len)
|
||||
@@ -928,7 +930,7 @@ namespace Volian.Print.Library
|
||||
nextprefix = rtfprefix;
|
||||
if (nextprefix != "") nextprefix += " ";
|
||||
start = lastspace + 1;
|
||||
width = 0;
|
||||
width = (width - startNonRtf - 1) > 0 ? width - startNonRtf - 1 : 0;
|
||||
lastspace = 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user