OLD | NEW |
---|---|
(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 | |
OLD | NEW |