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

Side by Side Diff: ui/gfx/mac/coordinate_conversion.mm

Issue 854713003: More old files deletion. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix tryjobs? Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « ui/gfx/mac/coordinate_conversion.h ('k') | ui/gfx/mac/coordinate_conversion_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ui/gfx/mac/coordinate_conversion.h"
6
7 #import <Cocoa/Cocoa.h>
8
9 #include "ui/gfx/geometry/rect.h"
10
11 namespace gfx {
12
13 namespace {
14
15 // The height of the primary display, which OSX defines as the monitor with the
16 // menubar. This is always at index 0.
17 CGFloat PrimaryDisplayHeight() {
18 return NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]);
19 }
20
21 } // namespace
22
23 NSRect ScreenRectToNSRect(const gfx::Rect& rect) {
24 return NSMakeRect(rect.x(),
25 PrimaryDisplayHeight() - rect.y() - rect.height(),
26 rect.width(),
27 rect.height());
28 }
29
30 gfx::Rect ScreenRectFromNSRect(const NSRect& rect) {
31 return gfx::Rect(rect.origin.x,
32 PrimaryDisplayHeight() - rect.origin.y - rect.size.height,
33 rect.size.width,
34 rect.size.height);
35 }
36
37 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/mac/coordinate_conversion.h ('k') | ui/gfx/mac/coordinate_conversion_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698