mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-20 11:39:36 +01:00
LCL carbon: fixed text layout cache recalculations, when context changed
git-svn-id: trunk@13972 -
This commit is contained in:
parent
543e960d76
commit
08f44d0d80
@ -923,15 +923,24 @@ procedure TCarbonTextLayoutArray.Apply(ADC: TCarbonContext);
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
FAscent := FFont.FCachedLayouts[Ord(FText[1])].FAscent;
|
||||
FDescent := FFont.FCachedLayouts[Ord(FText[1])].FDescent;
|
||||
FTextBefore := FFont.FCachedLayouts[Ord(FText[1])].FTextBefore;
|
||||
FTextAfter := FTextBefore;
|
||||
FAscent := 0;
|
||||
FDescent := 0;
|
||||
FTextBefore := 0;
|
||||
FTextAfter := 0;
|
||||
|
||||
for I := 1 to Length(FText) do
|
||||
begin
|
||||
FFont.FCachedLayouts[Ord(FText[I])].Apply(ADC);
|
||||
FTextAfter := FTextAfter + Long2Fix(FFont.FCachedLayouts[Ord(FText[I])].GetWidth);
|
||||
|
||||
if I > 1 then
|
||||
FTextAfter := FTextAfter + Long2Fix(FFont.FCachedLayouts[Ord(FText[I])].GetWidth)
|
||||
else
|
||||
begin
|
||||
FAscent := FFont.FCachedLayouts[Ord(FText[1])].FAscent;
|
||||
FDescent := FFont.FCachedLayouts[Ord(FText[1])].FDescent;
|
||||
FTextBefore := FFont.FCachedLayouts[Ord(FText[1])].FTextBefore;
|
||||
FTextAfter := FTextBefore;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1115,6 +1124,7 @@ function TCarbonFont.CreateTextLayout(const Text: String;
|
||||
C: Byte;
|
||||
begin
|
||||
Result := False;
|
||||
Exit;
|
||||
for I := 1 to Length(Text) do
|
||||
begin
|
||||
C := Ord(Text[I]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user