Skip to content

Commit

Permalink
xAxis labels fixed on iPhone 5s and later Boris-Em#294
Browse files Browse the repository at this point in the history
  • Loading branch information
diniska committed May 11, 2017
1 parent 0a4f545 commit 02d50ce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Classes/BEMSimpleLineGraphView.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

const CGFloat BEMNullGraphValue = CGFLOAT_MAX;

static inline BOOL CGRectContainsRectHorizontally(CGRect rect1, CGRect rect2) {
return CGRectGetMinX(rect1) <= CGRectGetMinX(rect2) &&
CGRectGetMaxX(rect2) <= CGRectGetMaxX(rect1);
}

#if !__has_feature(objc_arc)
// Add the -fobjc-arc flag to enable ARC for only these files, as described in the ARC documentation: http://clang.llvm.org/docs/AutomaticReferenceCounting.html
Expand Down Expand Up @@ -792,7 +796,7 @@ - (void)drawXAxis {
else [overlapLabels addObject:label]; // Overlapped
}

BOOL fullyContainsLabel = CGRectContainsRect(self.bounds, label.frame);
BOOL fullyContainsLabel = CGRectContainsRectHorizontally(self.bounds, label.frame);
if (!fullyContainsLabel) {
[overlapLabels addObject:label];
}
Expand Down

1 comment on commit 02d50ce

@diniska
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. It is just temporary fix in original repository fork.

Please sign in to comment.