mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 20:59:12 +02:00
TAChart: Refactor TChartAxis.GetMarkValues and add FIXME comment
+ Add forgotten line from the previous commit. git-svn-id: trunk@36165 -
This commit is contained in:
parent
f7c92839bd
commit
dfa6c71041
@ -453,6 +453,7 @@ procedure TChartAxis.Draw;
|
|||||||
// Only draw minor marks strictly inside the major mark interval.
|
// Only draw minor marks strictly inside the major mark interval.
|
||||||
FValueMin := Max(FAxisTransf(AMin), FValueMin);
|
FValueMin := Max(FAxisTransf(AMin), FValueMin);
|
||||||
FValueMax := Min(FAxisTransf(AMax), FValueMax);
|
FValueMax := Min(FAxisTransf(AMax), FValueMax);
|
||||||
|
if FValueMax <= FValueMin then continue;
|
||||||
ExpandRange(FValueMin, FValueMax, -EPS);
|
ExpandRange(FValueMin, FValueMax, -EPS);
|
||||||
try
|
try
|
||||||
BeginDrawing;
|
BeginDrawing;
|
||||||
@ -542,22 +543,27 @@ var
|
|||||||
d: TValuesInRangeParams;
|
d: TValuesInRangeParams;
|
||||||
vis: TChartOnVisitSources;
|
vis: TChartOnVisitSources;
|
||||||
t: TChartValueText;
|
t: TChartValueText;
|
||||||
|
axisMin, axisMax: Double;
|
||||||
begin
|
begin
|
||||||
with FHelper do begin
|
with FHelper do begin
|
||||||
FValueMin := GetTransform.GraphToAxis(FValueMin);
|
axisMin := GetTransform.GraphToAxis(FValueMin);
|
||||||
FValueMax := GetTransform.GraphToAxis(FValueMax);
|
axisMax := GetTransform.GraphToAxis(FValueMax);
|
||||||
EnsureOrder(FValueMin, FValueMax);
|
|
||||||
Marks.Range.Intersect(FValueMin, FValueMax);
|
|
||||||
d := MakeValuesInRangeParams(FValueMin, FValueMax);
|
|
||||||
FValueMin := GetTransform.AxisToGraph(FValueMin);
|
|
||||||
FValueMax := GetTransform.AxisToGraph(FValueMax);
|
|
||||||
end;
|
end;
|
||||||
|
EnsureOrder(axisMin, axisMax);
|
||||||
|
Marks.Range.Intersect(axisMin, axisMax);
|
||||||
|
d := MakeValuesInRangeParams(axisMin, axisMax);
|
||||||
SetLength(FMarkValues, 0);
|
SetLength(FMarkValues, 0);
|
||||||
vis := TChartAxisList(Collection).OnVisitSources;
|
vis := TChartAxisList(Collection).OnVisitSources;
|
||||||
if Marks.AtDataOnly and Assigned(vis) then
|
if Marks.AtDataOnly and Assigned(vis) then begin
|
||||||
vis(@VisitSource, Self, d)
|
vis(@VisitSource, Self, d);
|
||||||
|
// FIXME: Intersect axisMin/Max with the union of series extents.
|
||||||
|
end
|
||||||
else
|
else
|
||||||
Marks.SourceDef.ValuesInRange(d, FMarkValues);
|
Marks.SourceDef.ValuesInRange(d, FMarkValues);
|
||||||
|
with FHelper do begin
|
||||||
|
FValueMin := GetTransform.AxisToGraph(axisMin);
|
||||||
|
FValueMax := GetTransform.AxisToGraph(axisMax);
|
||||||
|
end;
|
||||||
if Inverted then
|
if Inverted then
|
||||||
for i := 0 to High(FMarkValues) div 2 do begin
|
for i := 0 to High(FMarkValues) div 2 do begin
|
||||||
t := FMarkValues[i];
|
t := FMarkValues[i];
|
||||||
@ -814,10 +820,10 @@ end;
|
|||||||
procedure TChartAxis.VisitSource(ASource: TCustomChartSource; var AData);
|
procedure TChartAxis.VisitSource(ASource: TCustomChartSource; var AData);
|
||||||
var
|
var
|
||||||
ext: TDoubleRect;
|
ext: TDoubleRect;
|
||||||
p: TValuesInRangeParams;
|
p: TValuesInRangeParams absolute AData;
|
||||||
begin
|
begin
|
||||||
ext := ASource.Extent;
|
ext := ASource.Extent;
|
||||||
p := TValuesInRangeParams(AData);
|
//p := TValuesInRangeParams(AData);
|
||||||
p.FMin := Max(TDoublePointBoolArr(ext.a)[IsVertical], p.FMin);
|
p.FMin := Max(TDoublePointBoolArr(ext.a)[IsVertical], p.FMin);
|
||||||
p.FMax := Min(TDoublePointBoolArr(ext.b)[IsVertical], p.FMax);
|
p.FMax := Min(TDoublePointBoolArr(ext.b)[IsVertical], p.FMax);
|
||||||
Marks.SourceDef.ValuesInRange(p, FMarkValues);
|
Marks.SourceDef.ValuesInRange(p, FMarkValues);
|
||||||
|
Loading…
Reference in New Issue
Block a user