cocoa: update clientToScreen to respect content view #33046. Recognizing flipped views

git-svn-id: trunk@57170 -
This commit is contained in:
dmitry 2018-01-28 03:00:23 +00:00
parent 1c46505f21
commit 3b93e012cb
2 changed files with 7 additions and 2 deletions

View File

@ -3350,7 +3350,11 @@ var
begin
// 1. convert to window base
P.x := X;
P.y := frame.size.height-y; // convert to Cocoa system
if isFlipped then
p.y := Y
else
P.y := frame.size.height-y; // convert to Cocoa system
P := convertPoint_ToView(P, nil);
X := Round(P.X);

View File

@ -98,7 +98,8 @@ begin
Result := Handle <> 0;
if Result then
NSObject(Handle).lclLocalToScreen(P.X, P.Y);
// must use lclContentView! - it's client view
NSObject(Handle).lclContentView.lclLocalToScreen(P.X, P.Y);
end;
{------------------------------------------------------------------------------