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

Unified Diff: ios/chrome/browser/ui/util/CRUILabel+AttributeUtils.mm

Issue 2828743002: LabelObserver is no longer retained by the label (Closed)
Patch Set: Address comments Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/util/CRUILabel+AttributeUtils.mm
diff --git a/ios/chrome/browser/ui/util/CRUILabel+AttributeUtils.mm b/ios/chrome/browser/ui/util/CRUILabel+AttributeUtils.mm
index dee9ac44434c64255625baba08ca2d6b2e632fa1..56bf04af64cac7d229f4149c7a6db844b0b5c4ff 100644
--- a/ios/chrome/browser/ui/util/CRUILabel+AttributeUtils.mm
+++ b/ios/chrome/browser/ui/util/CRUILabel+AttributeUtils.mm
@@ -74,21 +74,4 @@ CGFloat GetAssociatedLineHeight(UILabel* label) {
self.attributedText = newString;
}
-- (void)cr_adjustLineHeightForMaximimumLines:(NSUInteger)maximumLines {
- CGSize labelSize = self.bounds.size;
- CGFloat lineHeight = self.cr_lineHeight;
- CGFloat numberOfLines = floorf(labelSize.height / lineHeight);
- CGSize maxSize = CGSizeMake(labelSize.width, CGFLOAT_MAX);
- CGSize textSize = [self sizeThatFits:maxSize];
-
- // |textSize.height| should be a multiple of |lineHeight|. If this is not the
- // case, then it is safer to fit one more line to ensure that the text of the
- // label is not cropped.
- CGFloat requiredNumberOfLines = ceilf(textSize.height / lineHeight);
- if (requiredNumberOfLines > numberOfLines) {
- requiredNumberOfLines = MIN(requiredNumberOfLines, maximumLines);
- self.cr_lineHeight = floorf(labelSize.height / requiredNumberOfLines);
- }
-}
-
@end
« no previous file with comments | « ios/chrome/browser/ui/util/CRUILabel+AttributeUtils.h ('k') | ios/chrome/browser/ui/util/CRUILabel+AttributeUtils_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698