mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 00:19:26 +02:00
cocoa: fix the detection of the row by coordinates. using scrollView documentVisible rect instead of visibileRect
This commit is contained in:
parent
7fb476c5cd
commit
8a971e273f
@ -269,6 +269,8 @@ implementation
|
||||
function LCLCoordToRow(tbl: NSTableView; X,Y: Integer): Integer;
|
||||
var
|
||||
pt : NSPoint;
|
||||
sc : NSScrollView;
|
||||
vr : NSRect;
|
||||
begin
|
||||
if not Assigned(tbl) then
|
||||
begin
|
||||
@ -276,10 +278,15 @@ begin
|
||||
Exit;
|
||||
end;
|
||||
|
||||
sc := tbl.enclosingScrollView;
|
||||
if Assigned(sc) then
|
||||
vr := sc.documentVisibleRect
|
||||
else
|
||||
vr := tbl.visibleRect;
|
||||
pt.x := X;
|
||||
if tbl.isFlipped
|
||||
then pt.y := Y + tbl.visibleRect.origin.y
|
||||
else pt.y := tbl.frame.size.height - Y - tbl.visibleRect.origin.y;
|
||||
then pt.y := Y + vr.origin.y
|
||||
else pt.y := tbl.frame.size.height - Y - vr.origin.y;
|
||||
|
||||
Result := tbl.rowAtPoint(pt);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user