mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 14:29:36 +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 }
|
||||
|
||||
TChartAxisHitTest = (ahtTitle, ahtLine, ahtLabels,
|
||||
TChartAxisHitTest = (ahtTitle, ahtLine, ahtLabels, ahtGrid,
|
||||
ahtAxisStart, ahtAxisCenter, ahtAxisEnd);
|
||||
TChartAxisHitTests = set of TChartAxisHitTest;
|
||||
|
||||
@ -470,6 +470,7 @@ var
|
||||
R: TRect;
|
||||
w, h, loc: Integer;
|
||||
p: Integer;
|
||||
t: TChartValueText;
|
||||
begin
|
||||
Result := [];
|
||||
if IsPointInPolygon(APoint, FTitlePolygon) then
|
||||
@ -501,7 +502,24 @@ begin
|
||||
if IsPointInRect(APoint, R) then
|
||||
Include(Result, ahtLine)
|
||||
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
|
||||
exit;
|
||||
|
Loading…
Reference in New Issue
Block a user