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

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

Issue 1543183002: Switch to standard integer types in ui/gfx/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/interpolated_transform_unittest.cc ('k') | ui/gfx/ios/uikit_util_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/gfx/ios/NSString+CrStringDrawing.h" 5 #import "ui/gfx/ios/NSString+CrStringDrawing.h"
6 6
7 #include <stddef.h>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "ui/gfx/ios/uikit_util.h" 10 #include "ui/gfx/ios/uikit_util.h"
9 11
10 @implementation NSString (CrStringDrawing) 12 @implementation NSString (CrStringDrawing)
11 13
12 - (CGRect)cr_boundingRectWithSize:(CGSize)size 14 - (CGRect)cr_boundingRectWithSize:(CGSize)size
13 font:(UIFont*)font { 15 font:(UIFont*)font {
14 NSDictionary* attributes = font ? @{NSFontAttributeName: font} : @{}; 16 NSDictionary* attributes = font ? @{NSFontAttributeName: font} : @{};
15 return [self boundingRectWithSize:size 17 return [self boundingRectWithSize:size
16 options:NSStringDrawingUsesLineFragmentOrigin 18 options:NSStringDrawingUsesLineFragmentOrigin
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 if (hi < lo) 63 if (hi < lo)
62 hi = lo; 64 hi = lo;
63 } else { 65 } else {
64 lo = guess + 1; 66 lo = guess + 1;
65 } 67 }
66 } 68 }
67 return [self cr_stringByCuttingToIndex:lo]; 69 return [self cr_stringByCuttingToIndex:lo];
68 } 70 }
69 71
70 @end 72 @end
OLDNEW
« no previous file with comments | « ui/gfx/interpolated_transform_unittest.cc ('k') | ui/gfx/ios/uikit_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698