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

Side by Side Diff: ui/gfx/ios/NSString+CrStringDrawing.mm

Issue 983413004: Eliminate ui/ios (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/ios/NSString+CrStringDrawing.h ('k') | ui/gfx/ios/NSString+CrStringDrawing_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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ui/ios/NSString+CrStringDrawing.h" 5 #import "ui/gfx/ios/NSString+CrStringDrawing.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/ios/uikit_util.h" 8 #include "ui/gfx/ios/uikit_util.h"
9 9
10 @implementation NSString (CrStringDrawing) 10 @implementation NSString (CrStringDrawing)
11 11
12 - (CGRect)cr_boundingRectWithSize:(CGSize)size 12 - (CGRect)cr_boundingRectWithSize:(CGSize)size
13 font:(UIFont*)font { 13 font:(UIFont*)font {
14 NSDictionary* attributes = font ? @{NSFontAttributeName: font} : @{}; 14 NSDictionary* attributes = font ? @{NSFontAttributeName: font} : @{};
15 return [self boundingRectWithSize:size 15 return [self boundingRectWithSize:size
16 options:NSStringDrawingUsesLineFragmentOrigin 16 options:NSStringDrawingUsesLineFragmentOrigin
17 attributes:attributes 17 attributes:attributes
18 context:nil]; 18 context:nil];
(...skipping 12 matching lines...) Expand all
31 31
32 - (CGSize)cr_sizeWithFont:(UIFont*)font { 32 - (CGSize)cr_sizeWithFont:(UIFont*)font {
33 if (!font) 33 if (!font)
34 return CGSizeZero; 34 return CGSizeZero;
35 NSDictionary* attributes = @{ NSFontAttributeName : font }; 35 NSDictionary* attributes = @{ NSFontAttributeName : font };
36 CGSize size = [self sizeWithAttributes:attributes]; 36 CGSize size = [self sizeWithAttributes:attributes];
37 return CGSizeMake(ceil(size.width), ceil(size.height)); 37 return CGSizeMake(ceil(size.width), ceil(size.height));
38 } 38 }
39 39
40 @end 40 @end
OLDNEW
« no previous file with comments | « ui/gfx/ios/NSString+CrStringDrawing.h ('k') | ui/gfx/ios/NSString+CrStringDrawing_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698