mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 09:39:25 +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;
|
m: array [TLabelDirection] of Integer absolute AMargins;
|
||||||
zero: Double;
|
zero: Double;
|
||||||
gp: TDoublePoint;
|
gp: TDoublePoint;
|
||||||
valueIsPositive: Boolean;
|
|
||||||
begin
|
begin
|
||||||
if not Marks.IsMarkLabelsVisible or not Marks.AutoMargins then exit;
|
if not Marks.IsMarkLabelsVisible or not Marks.AutoMargins then exit;
|
||||||
if MarkPositions = lmpInsideCenter then exit;
|
if MarkPositions = lmpInsideCenter then exit;
|
||||||
@ -1756,31 +1755,13 @@ begin
|
|||||||
labelText := FormattedMark(i);
|
labelText := FormattedMark(i);
|
||||||
if labelText = '' then continue;
|
if labelText = '' then continue;
|
||||||
|
|
||||||
valueIsPositive := TDoublePointBoolArr(gp)[not IsRotated] > zero;
|
|
||||||
dir := GetLabelDirection(i);
|
dir := GetLabelDirection(i);
|
||||||
|
|
||||||
with Marks.MeasureLabel(ADrawer, labelText) do
|
with Marks.MeasureLabel(ADrawer, labelText) do
|
||||||
dist := IfThen(dir in [ldLeft, ldRight], cx, cy);
|
dist := IfThen(dir in [ldLeft, ldRight], cx, cy);
|
||||||
if Marks.DistanceToCenter then
|
if Marks.DistanceToCenter then
|
||||||
dist := dist div 2;
|
dist := dist div 2;
|
||||||
|
|
||||||
if valueIsPositive then begin
|
m[dir] := Max(m[dir], dist + Marks.Distance);
|
||||||
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;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user