mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 00:19:22 +02:00
TAChart: Make TAxisClickTool respond to click on axis grid.
git-svn-id: trunk@60834 -
This commit is contained in:
parent
5ebc7810de
commit
643da08e7a
@ -81,7 +81,7 @@ type
|
|||||||
|
|
||||||
{ TChartAxis }
|
{ TChartAxis }
|
||||||
|
|
||||||
TChartAxisHitTest = (ahtTitle, ahtLine, ahtLabels,
|
TChartAxisHitTest = (ahtTitle, ahtLine, ahtLabels, ahtGrid,
|
||||||
ahtAxisStart, ahtAxisCenter, ahtAxisEnd);
|
ahtAxisStart, ahtAxisCenter, ahtAxisEnd);
|
||||||
TChartAxisHitTests = set of TChartAxisHitTest;
|
TChartAxisHitTests = set of TChartAxisHitTest;
|
||||||
|
|
||||||
@ -470,6 +470,7 @@ var
|
|||||||
R: TRect;
|
R: TRect;
|
||||||
w, h, loc: Integer;
|
w, h, loc: Integer;
|
||||||
p: Integer;
|
p: Integer;
|
||||||
|
t: TChartValueText;
|
||||||
begin
|
begin
|
||||||
Result := [];
|
Result := [];
|
||||||
if IsPointInPolygon(APoint, FTitlePolygon) then
|
if IsPointInPolygon(APoint, FTitlePolygon) then
|
||||||
@ -501,7 +502,24 @@ begin
|
|||||||
if IsPointInRect(APoint, R) then
|
if IsPointInRect(APoint, R) then
|
||||||
Include(Result, ahtLine)
|
Include(Result, ahtLine)
|
||||||
else if IsPointInside(APoint) then
|
else if IsPointInside(APoint) then
|
||||||
Include(Result, ahtLabels);
|
Include(Result, ahtLabels)
|
||||||
|
else begin
|
||||||
|
R := FHelper.FClipRect^;
|
||||||
|
for t in FMarkValues do begin
|
||||||
|
p := FHelper.GraphToImage(FHelper.FAxisTransf(t.FValue));
|
||||||
|
if IsVertical then begin
|
||||||
|
R.Top := p - ADelta;
|
||||||
|
R.Bottom := p + ADelta;
|
||||||
|
end else begin
|
||||||
|
R.Left := p - ADelta;
|
||||||
|
R.Right := p + ADelta;
|
||||||
|
end;
|
||||||
|
if IsPointInRect(APoint, R) then begin
|
||||||
|
Include(Result, ahtGrid);
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
if Result = [] then
|
if Result = [] then
|
||||||
exit;
|
exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user