From db5060e608207f8485a5fdb992263cd9fb7c4f3a Mon Sep 17 00:00:00 2001 From: dmitry Date: Fri, 16 Aug 2019 14:13:39 +0000 Subject: [PATCH] cocoa: update ScreenToLocal to support flipped controls git-svn-id: trunk@61705 - --- lcl/interfaces/cocoa/cocoaprivate.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/cocoa/cocoaprivate.pas b/lcl/interfaces/cocoa/cocoaprivate.pas index 735e578abb..971ff45ecb 100644 --- a/lcl/interfaces/cocoa/cocoaprivate.pas +++ b/lcl/interfaces/cocoa/cocoaprivate.pas @@ -1060,7 +1060,10 @@ begin // 2. convert from window to local P := convertPoint_FromView(P, nil); X := Round(P.x); - Y := Round(frame.size.height-P.y); // convert to Cocoa system + if isFlipped then + Y := Round(p.y) + else + Y := Round(frame.size.height-P.y); // convert to Cocoa system end; function LCLViewExtension.lclParent:id;