diff options
| author | Neil Hodgson <nyamatongwe@gmail.com> | 2014-05-03 18:23:19 +1000 |
|---|---|---|
| committer | Neil Hodgson <nyamatongwe@gmail.com> | 2014-05-03 18:23:19 +1000 |
| commit | 850baf30484384711aa410d3596531f49c15e1ac (patch) | |
| tree | d9d35a03985e8d634ab02ff0f2094c857b2aeb01 /cocoa/PlatCocoa.mm | |
| parent | 26ff1bba505f093c4755e4afd6eade6c3d582b7f (diff) | |
| download | scintilla-mirror-850baf30484384711aa410d3596531f49c15e1ac.tar.gz | |
Fix Point and PRectangle constructors to match changes in Platform.h.
Diffstat (limited to 'cocoa/PlatCocoa.mm')
| -rw-r--r-- | cocoa/PlatCocoa.mm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index da87a7b13..a0a0e8943 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -52,7 +52,9 @@ NSRect PRectangleToNSRect(PRectangle& rc) */ PRectangle NSRectToPRectangle(NSRect& rc) { - return PRectangle(rc.origin.x, rc.origin.y, rc.size.width + rc.origin.x, rc.size.height + rc.origin.y); + return PRectangle(rc.origin.x, rc.origin.y, + static_cast<XYPOSITION>(NSMaxX(rc)), + static_cast<XYPOSITION>(NSMaxY(rc))); } //-------------------------------------------------------------------------------------------------- @@ -1148,11 +1150,11 @@ PRectangle Window::GetPosition() win = reinterpret_cast<NSWindow*>(idWin); rect = [win frame]; } - int screenHeight = ScreenMax(win); + CGFloat screenHeight = ScreenMax(win); // Invert screen positions to match Scintilla return PRectangle( - NSMinX(rect), screenHeight - NSMaxY(rect), - NSMaxX(rect), screenHeight - NSMinY(rect)); + NSMinX(rect), static_cast<XYPOSITION>(screenHeight - NSMaxY(rect)), + NSMaxX(rect), static_cast<XYPOSITION>(screenHeight - NSMinY(rect))); } else { @@ -1336,11 +1338,11 @@ PRectangle Window::GetMonitorRect(Point) NSWindow* win = reinterpret_cast<NSWindow*>(idWin); NSScreen* screen = [win screen]; NSRect rect = [screen frame]; - int screenHeight = rect.origin.y + rect.size.height; + CGFloat screenHeight = rect.origin.y + rect.size.height; // Invert screen positions to match Scintilla return PRectangle( - NSMinX(rect), screenHeight - NSMaxY(rect), - NSMaxX(rect), screenHeight - NSMinY(rect)); + NSMinX(rect), static_cast<XYPOSITION>(screenHeight - NSMaxY(rect)), + NSMaxX(rect), static_cast<XYPOSITION>(screenHeight - NSMinY(rect))); } } return PRectangle(); |
