mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 00:39:44 +02:00
TAChart: Fix positioning of series labels (hopefully...) by reverting some of r56492 #1401108152. Issue #34819
git-svn-id: trunk@60077 -
This commit is contained in:
parent
e7abcc7ff1
commit
26d29fe3be
@ -1744,7 +1744,6 @@ var
|
||||
m: array [TLabelDirection] of Integer absolute AMargins;
|
||||
zero: Double;
|
||||
gp: TDoublePoint;
|
||||
valueIsPositive: Boolean;
|
||||
begin
|
||||
if not Marks.IsMarkLabelsVisible or not Marks.AutoMargins then exit;
|
||||
if MarkPositions = lmpInsideCenter then exit;
|
||||
@ -1756,31 +1755,13 @@ begin
|
||||
labelText := FormattedMark(i);
|
||||
if labelText = '' then continue;
|
||||
|
||||
valueIsPositive := TDoublePointBoolArr(gp)[not IsRotated] > zero;
|
||||
dir := GetLabelDirection(i);
|
||||
|
||||
with Marks.MeasureLabel(ADrawer, labelText) do
|
||||
dist := IfThen(dir in [ldLeft, ldRight], cx, cy);
|
||||
if Marks.DistanceToCenter then
|
||||
dist := dist div 2;
|
||||
|
||||
if valueIsPositive then begin
|
||||
if Marks.DistanceToCenter then
|
||||
case dir of
|
||||
ldBottom: dir := ldTop;
|
||||
ldLeft: dir := ldRight;
|
||||
end;
|
||||
if dir in [ldTop, ldRight] then
|
||||
m[dir] := Max(m[dir], dist + Marks.Distance);
|
||||
end else begin
|
||||
if Marks.DistanceToCenter then
|
||||
case dir of
|
||||
ldTop: dir := ldBottom;
|
||||
ldRight: dir := ldLeft;
|
||||
end;
|
||||
if dir in [ldBottom, ldLeft] then
|
||||
m[dir] := Max(m[dir], dist + Marks.Distance);
|
||||
end;
|
||||
m[dir] := Max(m[dir], dist + Marks.Distance);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user