IDE: syncompletion: improve painting of arguments (sum of textparts width is bigger than the whole text width on Qt).

git-svn-id: trunk@57836 -
This commit is contained in:
ondrej 2018-05-08 00:26:45 +00:00
parent 44882f708a
commit 864261daa3

View File

@ -233,12 +233,14 @@ var
nTokenLen: integer; nTokenLen: integer;
Attr: TSynHighlightElement; Attr: TSynHighlightElement;
CurForeground: TColor; CurForeground: TColor;
LeftText: string;
begin begin
if MeasureOnly then begin if MeasureOnly then begin
Inc(Result.X,ACanvas.TextWidth(s)); Inc(Result.X,ACanvas.TextWidth(s));
exit; exit;
end; end;
if (Highlighter<>nil) and AllowFontColor then begin if (Highlighter<>nil) and AllowFontColor then begin
LeftText := '';
Highlighter.ResetRange; Highlighter.ResetRange;
Highlighter.SetLine(s,0); Highlighter.SetLine(s,0);
while not Highlighter.GetEol do begin while not Highlighter.GetEol do begin
@ -251,8 +253,8 @@ var
if CurForeground=clNone then if CurForeground=clNone then
CurForeground:=TColor(ForegroundColor); CurForeground:=TColor(ForegroundColor);
SetFontColor(CurForeground); SetFontColor(CurForeground);
ACanvas.TextOut(x+1,y,s); ACanvas.TextOut(x+1+ACanvas.TextWidth(LeftText),y,s);
inc(x,ACanvas.TextWidth(s)); LeftText += s;
end; end;
Highlighter.Next; Highlighter.Next;
end; end;