mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 12:39:15 +02:00
TAChart: Correctly measure axis titles
git-svn-id: trunk@31714 -
This commit is contained in:
parent
9b3b52f19f
commit
938cbd7a55
@ -514,13 +514,14 @@ procedure TChartAxis.Measure(
|
||||
end;
|
||||
|
||||
function TitleSize: Integer;
|
||||
var
|
||||
sz: TSize;
|
||||
begin
|
||||
if not Title.Visible or (Title.Caption = '') then
|
||||
exit(0);
|
||||
sz := Title.MeasureLabel(FHelper.FDrawer, Title.Caption);
|
||||
Result := IfThen(IsVertical, sz.cx, sz.cy) + Title.Distance;
|
||||
with Title.MeasureLabel(FHelper.FDrawer, Title.Caption) do
|
||||
Result := IfThen(IsVertical, cx, cy);
|
||||
if Title.DistanceToCenter then
|
||||
Result := Result div 2;
|
||||
Result += FHelper.FDrawer.Scale(Title.Distance);
|
||||
end;
|
||||
|
||||
function FirstLastSize(AIndex: Integer): Integer;
|
||||
|
@ -1127,10 +1127,10 @@ begin
|
||||
CalculateTransformationCoeffs(Rect(0, 0, 0, 0));
|
||||
cr := FClipRect;
|
||||
for tries := 1 to 10 do begin
|
||||
FClipRect := cr;
|
||||
axisMargin := AxisList.Measure(CurrentExtent);
|
||||
axisMargin[calLeft] := Max(axisMargin[calLeft], Depth);
|
||||
axisMargin[calBottom] := Max(axisMargin[calBottom], Depth);
|
||||
FClipRect := cr;
|
||||
for aa := Low(aa) to High(aa) do
|
||||
SideByAlignment(FClipRect, aa, -axisMargin[aa]);
|
||||
prevExt := FCurrentExtent;
|
||||
|
Loading…
Reference in New Issue
Block a user