Skip to content

Commit

Permalink
VTIG_FreeChar properly supports defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
epyon committed Aug 20, 2024
1 parent 3ae2b4a commit 435e6ba
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/vtig.pas
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ procedure VTIG_FreeLabel( aText : Ansistring; aPos : TIOPoint; aColor : TIOColor
procedure VTIG_FreeLabel( aText : Ansistring; aArea : TIORect; aColor : TIOColor = 0 ); overload;
procedure VTIG_FreeLabel( aText : Ansistring; aPos : TIOPoint; aParams : array of const; aColor : TIOColor = 0 ); overload;
procedure VTIG_FreeLabel( aText : Ansistring; aArea : TIORect; aParams : array of const; aColor : TIOColor = 0 ); overload;
procedure VTIG_FreeChar( aChar : Char; aPos : TIOPoint; aColor : TIOColor = 0; aBGColor : TIOColor = 0 );
procedure VTIG_FreeChar( aChar : Char; aPos : TIOPoint; aColor : TIOColor; aBGColor : TIOColor );
procedure VTIG_FreeChar( aChar : Char; aPos : TIOPoint; aColor : TIOColor );
procedure VTIG_FreeChar( aChar : Char; aPos : TIOPoint );
procedure VTIG_Text( aText : Ansistring; aColor : TIOColor = 0; aBGColor : TIOColor = 0 );
procedure VTIG_Text( aText : Ansistring; aParams : array of const; aColor : TIOColor = 0; aBGColor : TIOColor = 0 );
function VTIG_Length( const aText: AnsiString ) : Integer;
Expand Down Expand Up @@ -956,15 +958,27 @@ procedure VTIG_FreeLabel( aText : Ansistring; aArea : TIORect; aParams : array o
VTIG_RenderText( aText, iStart, iClip, aParams );
end;

procedure VTIG_FreeChar( aChar : Char; aPos : TIOPoint; aColor : TIOColor = 0; aBGColor : TIOColor = 0 );
procedure VTIG_FreeChar( aChar : Char; aPos : TIOPoint; aColor : TIOColor; aBGColor : TIOColor );
begin
if aColor = 0 then aColor := GCtx.Style^.Color[ VTIG_TEXT_COLOR ];
if aBGColor = 0 then aBGColor := GCtx.Style^.Color[ VTIG_BACKGROUND_COLOR ];
GCtx.Color := aColor;
GCtx.BGColor := aBGColor;
VTIG_RenderChar( aChar, aPos );
end;

procedure VTIG_FreeChar( aChar : Char; aPos : TIOPoint; aColor : TIOColor );
begin
GCtx.Color := aColor;
GCtx.BGColor := GCtx.Style^.Color[ VTIG_BACKGROUND_COLOR ];
VTIG_RenderChar( aChar, aPos );
end;

procedure VTIG_FreeChar( aChar : Char; aPos : TIOPoint );
begin
GCtx.Color := GCtx.Style^.Color[ VTIG_TEXT_COLOR ];
GCtx.BGColor := GCtx.Style^.Color[ VTIG_BACKGROUND_COLOR ];
VTIG_RenderChar( aChar, aPos );
end;

procedure VTIG_Text( aText : Ansistring; aParams : array of const; aColor : TIOColor = 0; aBGColor : TIOColor = 0 );
var iClip : TIORect;
iStart : TIOPoint;
Expand Down

0 comments on commit 435e6ba

Please sign in to comment.