diff options
| author | Pietro Gagliardi <[email protected]> | 2014-05-15 21:45:42 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-05-15 21:45:42 -0400 |
| commit | 31fc77a99df84e334e97cb6718a3f45fa097d2b4 (patch) | |
| tree | 1b61f0d52dc25869b253cab5f5da1f5b2a2e502a /area_darwin.m | |
| parent | 82101036b8b2686ec0394908434629ab6a0b9903 (diff) | |
Removed the event point translation from bleh_darwin.m and rewrote it in Objective-C in area_darwin.m.
Diffstat (limited to 'area_darwin.m')
| -rw-r--r-- | area_darwin.m | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/area_darwin.m b/area_darwin.m index f283b5e..c45aa40 100644 --- a/area_darwin.m +++ b/area_darwin.m @@ -10,6 +10,7 @@ #define to(T, x) ((T *) (x)) #define toNSEvent(x) to(NSEvent, (x)) +#define toAreaView(x) to(areaView, (x)) #define toNSInteger(x) ((NSInteger) (x)) #define fromNSInteger(x) ((intptr_t) (x)) @@ -110,7 +111,16 @@ uintptr_t modifierFlags(id e) return fromNSUInteger([toNSEvent(e) modifierFlags]); } -// TODO move getTranslatedEventPoint() here +struct xpoint getTranslatedEventPoint(id area, id e) +{ + NSPoint p; + struct xpoint q; + + p = [toAreaView(area) convertPoint:[toNSEvent(e) locationInWindow] fromView:nil]; + q.x = (intptr_t) p.x; + q.y = (intptr_t) p.y; + return q; +} intptr_t buttonNumber(id e) { |
