TAChart: Additional checks to prevent drawing of axis marks outside the axis range

git-svn-id: trunk@31856 -
This commit is contained in:
ask 2011-08-03 15:28:06 +00:00
parent 89c458bc8d
commit b6c83f2721
2 changed files with 10 additions and 3 deletions

View File

@ -640,8 +640,9 @@ begin
if not Visible then exit;
v := IsVertical;
d := FHelper.FDrawer;
GetMarkValues(
TDoublePointBoolArr(AExtent.a)[v], TDoublePointBoolArr(AExtent.b)[v]);
FHelper.FValueMin := TDoublePointBoolArr(AExtent.a)[v];
FHelper.FValueMax := TDoublePointBoolArr(AExtent.b)[v];
GetMarkValues(FHelper.FValueMin, FHelper.FValueMax);
sz := Marks.Measure(d, not v, TickLength, FMarkValues);
FHelper.GetClipRange(rmin, rmax);
minc := MaxInt;

View File

@ -215,6 +215,8 @@ type
FScaledTickLength: Integer;
FStripeIndex: Cardinal;
FTransf: ICoordTransformer;
FValueMax: Double;
FValueMin: Double;
FZOffset: TPoint;
procedure BeginDrawing; virtual;
@ -297,6 +299,8 @@ begin
Result.FClipRect := FClipRect;
Result.FDrawer := FDrawer;
Result.FTransf := FTransf;
Result.FValueMax := FValueMax;
Result.FValueMin := FValueMin;
Result.FZOffset := FZOffset;
end;
@ -318,7 +322,9 @@ var
coord: Integer;
begin
coord := GraphToImage(AMark);
if not IsInClipRange(coord) then exit;
if
not IsInClipRange(coord) or not InRange(AMark, FValueMin, FValueMax)
then exit;
if FAxis.Grid.Visible then begin
FDrawer.Pen := FAxis.Grid;