Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Unified Diff: ui/base/cocoa/base_view.mm

Issue 10545050: mac: Use NSWidth() and friends in a few more places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « skia/ext/skia_utils_mac.mm ('k') | ui/base/cocoa/base_view_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/cocoa/base_view.mm
diff --git a/ui/base/cocoa/base_view.mm b/ui/base/cocoa/base_view.mm
index 0d63acf69ea4eba62f5bc807baa7e0caeaac57e2..d5f89e89aadf8570a0872d8c3ae80d11a3d447a7 100644
--- a/ui/base/cocoa/base_view.mm
+++ b/ui/base/cocoa/base_view.mm
@@ -133,14 +133,13 @@ NSString* kSelectionDirection = @"Chromium.kSelectionDirection";
- (gfx::Rect)flipNSRectToRect:(NSRect)rect {
gfx::Rect new_rect(NSRectToCGRect(rect));
- new_rect.set_y([self bounds].size.height - new_rect.y() - new_rect.height());
+ new_rect.set_y(NSHeight([self bounds]) - new_rect.bottom());
return new_rect;
}
- (NSRect)flipRectToNSRect:(gfx::Rect)rect {
NSRect new_rect(NSRectFromCGRect(rect.ToCGRect()));
- new_rect.origin.y =
- [self bounds].size.height - new_rect.origin.y - new_rect.size.height;
+ new_rect.origin.y = NSHeight([self bounds]) - NSMaxY(new_rect);
return new_rect;
}
« no previous file with comments | « skia/ext/skia_utils_mac.mm ('k') | ui/base/cocoa/base_view_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698