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.
5 #include "ui/gfx/ios/uikit_util.h"
7 #import <UIKit/UIKit.h>
13 CGFloat AlignValueToUpperPixel(CGFloat value) {
14 CGFloat scale = [[UIScreen mainScreen] scale];
15 return std::ceil(value * scale) / scale;
18 CGSize AlignSizeToUpperPixel(CGSize size) {
19 return CGSizeMake(AlignValueToUpperPixel(size.width),
20 AlignValueToUpperPixel(size.height));