Added code to resolve issue when trying to convert Wolf Creek Temporary procedures
This commit is contained in:
@@ -1195,6 +1195,10 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
}
|
||||
public void AdjustWidthForContent()
|
||||
{
|
||||
AdjustWidthForContent(0);
|
||||
}
|
||||
public void AdjustWidthForContent(int count)
|
||||
{
|
||||
int widthNL = Ceiling(GetStringWidth("\n"));
|
||||
int widthMax = 0;
|
||||
@@ -1214,10 +1218,8 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
int w = pointEnd.X + (indexEnd - indexEndPos) * widthNL;
|
||||
if (w > widthMaxWW)
|
||||
{
|
||||
widthMaxWW = w;
|
||||
}
|
||||
}
|
||||
if (lineEnd > lineStart)// this indicates that there was word-wrap on this line.
|
||||
{
|
||||
int w = pointEnd.X + Width * (lineEnd - lineStart);
|
||||
@@ -1237,14 +1239,20 @@ namespace Volian.Controls.Library
|
||||
int w = widthMax + widthNL + widthBorder;
|
||||
if (Width != w)
|
||||
{
|
||||
if (count < 5 || Width < w)
|
||||
{
|
||||
Width = w;
|
||||
AdjustWidthForContent();// Try one more time
|
||||
AdjustWidthForContent(count + 1);// Try one more time
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (count < 5 || Width < widthMaxWW)
|
||||
{
|
||||
Width = widthMaxWW;
|
||||
AdjustWidthForContent();
|
||||
AdjustWidthForContent(count + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
public int CalculateHeight()
|
||||
|
Reference in New Issue
Block a user