From 23e4d293dc19ce496da33b3929c9b71952148e86 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sat, 28 Apr 2007 15:25:11 +0000 Subject: 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 --- Game/Code/Menu/UMenuText.pas | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'Game/Code/Menu') 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; -- cgit v1.2.3