You've already forked lazarus-ccr
NiceChart: Activate clipping at the chart box boundaries.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8862 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1471,16 +1471,24 @@ begin
|
|||||||
AutoColors(ACanvas, Index, sr.FKind = skBar);
|
AutoColors(ACanvas, Index, sr.FKind = skBar);
|
||||||
with ACanvas do
|
with ACanvas do
|
||||||
begin
|
begin
|
||||||
|
ClipRect := RcChart;
|
||||||
if (sr.FKind = skBar) then
|
if (sr.FKind = skBar) then
|
||||||
begin
|
begin
|
||||||
|
Clipping := true;
|
||||||
|
try
|
||||||
Pen.Width := 1;
|
Pen.Width := 1;
|
||||||
for x := 0 to Sr.Values.Count-1 do
|
for x := 0 to Sr.Values.Count-1 do
|
||||||
begin
|
begin
|
||||||
P := PXYInfo(Sr.Values[x]);
|
P := PXYInfo(Sr.Values[x]);
|
||||||
Rectangle(P^.Rc);
|
Rectangle(P^.Rc);
|
||||||
end;
|
end;
|
||||||
|
finally
|
||||||
|
Clipping := false;
|
||||||
|
end;
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
|
Clipping := true;
|
||||||
|
try
|
||||||
if (sr.FKind = skLine) then
|
if (sr.FKind = skLine) then
|
||||||
begin
|
begin
|
||||||
Pen.Width := sr.LineWidth;
|
Pen.Width := sr.LineWidth;
|
||||||
@ -1497,10 +1505,14 @@ begin
|
|||||||
Pen.Width := sr.LineWidth;
|
Pen.Width := sr.LineWidth;
|
||||||
sr.Spline.Draw(ACanvas);
|
sr.Spline.Draw(ACanvas);
|
||||||
end;
|
end;
|
||||||
|
finally
|
||||||
|
Clipping := false;
|
||||||
|
end;
|
||||||
Pen.Width := 1;
|
Pen.Width := 1;
|
||||||
for x := 0 to Sr.Values.Count-1 do
|
for x := 0 to Sr.Values.Count-1 do
|
||||||
begin
|
begin
|
||||||
P := PXYInfo(Sr.Values[x]);
|
P := PXYInfo(Sr.Values[x]);
|
||||||
|
if PtInRect(RcChart, Point(P^.Px, P^.Py)) then
|
||||||
Marker(ACanvas, P^.Px, P^.Py, MarkSize);
|
Marker(ACanvas, P^.Px, P^.Py, MarkSize);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user