Chromium Code Reviews| Index: ui/ios/NSString+CrStringDrawing.h |
| diff --git a/ui/ios/NSString+CrStringDrawing.h b/ui/ios/NSString+CrStringDrawing.h |
| index 330593ea9d1c91275b8f3874a19749ca4aa9ec9c..71228023a124701745d4f9c69d220918584880e5 100644 |
| --- a/ui/ios/NSString+CrStringDrawing.h |
| +++ b/ui/ios/NSString+CrStringDrawing.h |
| @@ -9,6 +9,26 @@ |
| @interface NSString (CrStringDrawing) |
| +// Calculates and returns the bounding rect for the receiver drawn using the |
| +// given size and font. |
| +// This method is implemented as a wrapper around |
| +// |boundingRectWithSize:options:attributes:context:| using the following values |
| +// for the parameters: |
| +// - size: the provided |size| |
| +// - options: NSStringDrawingUsesLineFragmentOrigin |
| +// - attributes: a NSDictionary with the provided |font|. |
|
lpromero
2014/11/06 16:17:44
The period could go on the next line.
lliabraa
2014/11/06 16:35:47
Done.
|
| +// - context: nil |
| +// |
| +// Note that the rect returned may contain fractional values. |
|
lpromero
2014/11/06 16:17:43
What do you think of:
+// Use |ceil| to raise the
lliabraa
2014/11/06 16:35:47
I've opted to return fractional values to keep the
|
| +- (CGRect)cr_boundingRectWithSize:(CGSize)size |
| + font:(UIFont*)font; |
| + |
| +// Convenience wrapper to just return the size of |boundingRectWithSize:font:|. |
| +// |
| +// Note that the size returned may contain fractional values. |
|
lpromero
2014/11/06 16:17:44
Idem?
lliabraa
2014/11/06 16:35:47
Acknowledged.
|
| +- (CGSize)cr_boundingSizeWithSize:(CGSize)size |
| + font:(UIFont*)font; |
| + |
| // Returns the size of the string if it were to be rendered with the specified |
| // font on a single line. The width and height of the CGSize returned are |
| // pixel-aligned. |