mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-14 00:59:38 +02:00
TAChart: Fix positioning of rotated text by AggPas drawer.
git-svn-id: trunk@55488 -
This commit is contained in:
parent
7465018e20
commit
15891477c3
@ -268,7 +268,7 @@ begin
|
||||
f.LoadFromFile(
|
||||
AFont.Name, f.SizeToAggHeight(fontSize), AFont.Bold, AFont.Italic);
|
||||
f.FPColor := ApplyTransparency(FPColorOrMono(AFont.FPColor));
|
||||
f.AggAngle := OrientToRad(-FGetFontOrientationFunc(AFont));
|
||||
f.AggAngle := -OrientToRad(FGetFontOrientationFunc(AFont));
|
||||
end;
|
||||
|
||||
type
|
||||
@ -293,8 +293,15 @@ begin
|
||||
end;
|
||||
|
||||
procedure TAggPasDrawer.SimpleTextOut(AX, AY: Integer; const AText: String);
|
||||
var
|
||||
h: Integer;
|
||||
p: TPoint;
|
||||
begin
|
||||
FCanvas.TextOut(AX, AY, AText);
|
||||
h := SimpleTextExtent('Tg').y;
|
||||
p := RotatePoint(Point(0, h * 9 div 10), FCanvas.Font.AggAngle);
|
||||
// * 9/10 fits to fit the text into bounding box
|
||||
FCanvas.TextOut(AX + p.X, AY + p.Y - h, AText);
|
||||
// -h to avoid rotated text drifting away
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
Loading…
Reference in New Issue
Block a user