blob: 2e0bfdb21468a5013e3cd1ccf41b66583b4a8b29 [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/gfx/ios/uikit_util.h"
#import <UIKit/UIKit.h>
#include <cmath>
namespace ui {
CGFloat AlignValueToUpperPixel(CGFloat value) {
CGFloat scale = [[UIScreen mainScreen] scale];
return std::ceil(value * scale) / scale;
CGSize AlignSizeToUpperPixel(CGSize size) {
return CGSizeMake(AlignValueToUpperPixel(size.width),
} // namespace ui