aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Menu
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-04-28 15:25:11 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-04-28 15:25:11 +0000
commit23e4d293dc19ce496da33b3929c9b71952148e86 (patch)
tree93fd671dea13a742ebdfdf793d7beec4370517d6 /Game/Code/Menu
parentef87bafc41e7321c8559a23005c79de88b625741 (diff)
downloadusdx-23e4d293dc19ce496da33b3929c9b71952148e86.tar.gz
usdx-23e4d293dc19ce496da33b3929c9b71952148e86.tar.xz
usdx-23e4d293dc19ce496da33b3929c9b71952148e86.zip
Fixed a Bug in UMenuText that causes that Text with only one Char is not displayed
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@148 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Menu/UMenuText.pas20
1 files changed, 14 insertions, 6 deletions
diff --git a/Game/Code/Menu/UMenuText.pas b/Game/Code/Menu/UMenuText.pas
index 0ebaede2..abf3784c 100644
--- a/Game/Code/Menu/UMenuText.pas
+++ b/Game/Code/Menu/UMenuText.pas
@@ -105,7 +105,7 @@ var
end;
procedure AddBreak(const From, bTo: Cardinal);
begin
- if (isBreak) OR (bTo - From > 1) then
+ if (isBreak) OR (bTo - From >= 1) then
begin
Inc(Len);
SetLength (TextTiles, Len);
@@ -122,6 +122,18 @@ begin
//Set TExtstring
TextString := Value;
+ //Set Cursor Visible
+ SelectBlink := True;
+ STicks := GettickCount div 550;
+
+ //Exit if there is no Need to Create Tiles
+ If (W <= 0) and (Pos('\n', Value) = 0) then
+ begin
+ SetLength (TextTiles, 1);
+ TextTiles[0] := Value;
+ Exit;
+ end;
+
//Create Tiles
//Reset Text Array
SetLength (TextTiles, 0);
@@ -133,6 +145,7 @@ begin
LastBreak := 1;
FirstWord := 1;
+
if (W > 0) then
begin
//Set Font Propertys
@@ -140,7 +153,6 @@ begin
SetFontSize(Size);
end;
-
//go Through Text
While (GetNextPos) do
begin
@@ -186,10 +198,6 @@ begin
end;
//Add Ending
AddBreak(LastBreak, Length(Value)+1);
-
- //Set Cursor Visible
- SelectBlink := True;
- STicks := GettickCount div 550;
end;
Procedure TText.DeleteLastL;