plotpanel: Clip curve outside the drawing area defined by the axes.

git-svn-id: trunk@56334 -
This commit is contained in:
wp 2017-11-06 23:28:11 +00:00
parent 565c1544e4
commit d3268fe1b4

View File

@ -1168,6 +1168,8 @@ procedure TCanvasPlotter.PlotFunction(ACanvas: TCanvas);
Var
POX,PX,PXW,PY,POY,PEY,PYH,PLX,PLY : Integer; // Pixel units
X,Y,XI,YI,YO : TPlotFloat; // Plot units
R: TRect;
clp: Boolean;
begin
// X-origin in pixels.
@ -1196,6 +1198,11 @@ begin
ACanvas.Pen.Width := FPlotLineWidth;
PLX:=POX;
PLY:=POY;
R := ACanvas.ClipRect;
clp := ACanvas.Clipping;
ACanvas.ClipRect := Rect(POX, FYAxis.TopMargin, PXW + POX, POY);
ACanvas.Clipping := true;
try
For PX:=0 to PXW do
begin
try
@ -1225,6 +1232,10 @@ begin
X:=X+XI;
end;
finally
ACanvas.ClipRect := R;
ACanvas.Clipping := clp;
end;
end;
function TCanvasPlotter.GetHDimension: Integer;