Skip to content

Commit

Permalink
Fix up some CGFloat handling in NIAttributedLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanemoore committed Feb 21, 2014
1 parent 4061269 commit c26550d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/attributedlabel/src/NIAttributedLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ - (CGFloat)_verticalOffsetForBounds:(CGRect)bounds {
CGSize textSize = [self sizeThatFits:CGSizeMake(bounds.size.width, CGFLOAT_MAX)];

if (NIVerticalTextAlignmentMiddle == self.verticalTextAlignment) {
verticalOffset = floorf((bounds.size.height - textSize.height) / 2.f);
verticalOffset = NICGFloatFloor((bounds.size.height - textSize.height) / 2.f);

} else if (NIVerticalTextAlignmentBottom == self.verticalTextAlignment) {
verticalOffset = bounds.size.height - textSize.height;
Expand Down Expand Up @@ -890,8 +890,8 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
// If the user moves their finger within the link beyond a certain gutter amount, reset the
// hold timer. The user must hold their finger still for the long press interval in order for
// the long press action to fire.
if (fabsf(self.touchPoint.x - point.x) >= kLongPressGutter
|| fabsf(self.touchPoint.y - point.y) >= kLongPressGutter) {
if (NICGFloatAbs(self.touchPoint.x - point.x) >= kLongPressGutter
|| NICGFloatAbs(self.touchPoint.y - point.y) >= kLongPressGutter) {
[self.longPressTimer invalidate];
self.longPressTimer = nil;
if (nil != self.touchedLink) {
Expand Down

0 comments on commit c26550d

Please sign in to comment.