mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-13 12:49:50 +02:00
gtk2 intf: improved layout text optimization by length parameter
git-svn-id: trunk@15763 -
This commit is contained in:
parent
7e001b2934
commit
fbcc1bc581
lcl/interfaces/gtk2
@ -44,7 +44,7 @@ type
|
||||
procedure DrawTextWithColors(AText: PChar; ALength: LongInt; X, Y: Integer; FGColor, BGColor: PGdkColor);
|
||||
end;
|
||||
|
||||
procedure SetLayoutText(ALayout: PPangoLayout; AText: PChar; ALength: LongInt);
|
||||
procedure SetLayoutText(ALayout: PPangoLayout; AText: PChar; ALength: PtrInt);
|
||||
|
||||
implementation
|
||||
{$i gtk2devicecontext.inc}
|
||||
|
@ -24,12 +24,12 @@
|
||||
// {$DEFINE ASSERT_IS_ON}
|
||||
{$ENDIF}
|
||||
|
||||
procedure SetLayoutText(ALayout: PPangoLayout; AText: PChar; ALength: LongInt);
|
||||
procedure SetLayoutText(ALayout: PPangoLayout; AText: PChar; ALength: PtrInt);
|
||||
var
|
||||
OldStr: PChar;
|
||||
begin
|
||||
OldStr := pango_layout_get_text(ALayout);
|
||||
if (strcomp(AText, OldStr) <> 0) then
|
||||
if (strlcomp(AText, OldStr, ALength) <> 0) then
|
||||
pango_layout_set_text(ALayout, AText, ALength);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user