Permalink
Browse files

fix integrals errors

  • Loading branch information...
1 parent bf514ac commit 3db539ff0e4921d06750d3851117b789efc3527e @ettore committed Jan 22, 2014
Showing with 6 additions and 4 deletions.
  1. +5 −3 categories/CLCGUILabelCategory.m
  2. +1 −1 categories/CLCGUIViewCategory.m
@@ -6,6 +6,8 @@
// Copyright (c) 2012 Goodreads. All rights reserved.
//
+#import "tgmath.h"
+
#import "CLCGUILabelCategory.h"
#import "CLCGUIViewCategory.h"
@@ -20,14 +22,14 @@ -(void)sizeToFitWidth:(CGFloat)w
sz = CGSizeMake(w, INT_MAX);
sz = [[self text] sizeWithFont:[self font] constrainedToSize:sz];
- [self setW:sz.width];
- [self setH:sz.height];
+ [self setW:ceil(sz.width)];
+ [self setH:ceil(sz.height)];
}
-(void)resizeHeightForText
{
- return [self resizeHeightForText:[self text] font:[self font]];
+ [self resizeHeightForText:[self text] font:[self font]];
}
@@ -90,7 +90,7 @@ -(void)resizeHeightForText:(NSString*)txt font:(UIFont*)font
sz = CGSizeMake([self w], INT_MAX);
sz = [txt sizeWithFont:font constrainedToSize:sz];
- [self setH:sz.height];
+ [self setH:ceil(sz.height)]; // Can't round down, may make last line disappear
}

0 comments on commit 3db539f

Please sign in to comment.