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

Side by Side Diff: ui/ios/uikit_util.mm

Issue 539253002: Add a couple UIKit util functions in src/ui/ios/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
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 #include "ui/ios/uikit_util.h"
6
7 #import <UIKit/UIKit.h>
8
9 namespace ui {
10
11 CGFloat alignValueToUpperPixel(CGFloat value) {
12 CGFloat scale = [[UIScreen mainScreen] scale];
13 return ceil(value * scale) / scale;
stuartmorgan 2014/09/04 22:16:11 std::ceil so it does the right thing with 64-bit?
lliabraa 2014/09/05 16:53:44 Done.
14 }
15
16 CGSize alignSizeToUpperPixel(CGSize size) {
17 return CGSizeMake(alignValueToUpperPixel(size.width),
18 alignValueToUpperPixel(size.height));
stuartmorgan 2014/09/04 22:16:11 Should align inside the (
lliabraa 2014/09/05 16:53:45 Done.
19 }
20
21 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698