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