Skip to content

Commit

Permalink
Fixed iOS 4.2 layout issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lippling committed Feb 2, 2012
1 parent 2afc4dd commit efedaeb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion MBProgressHUD.m
Expand Up @@ -342,7 +342,8 @@ - (void)layoutSubviews {
CGRect frame = self.bounds;

// Compute HUD dimensions based on indicator size (add margin to HUD border)
CGRect indFrame = indicator.bounds;
CGRect indFrame = CGRectZero; // CGRect indFrame = indicator.bounds; <- This line caused issues on armv6 architecture / Release mode, with iOS SDK 5.0 and LLVM 3.0 compiler
indFrame.size = indicator.bounds.size;
self.width = indFrame.size.width + 2 * margin;
self.height = indFrame.size.height + 2 * margin;

Expand Down

4 comments on commit efedaeb

@matej
Copy link

@matej matej commented on efedaeb Feb 16, 2012

Choose a reason for hiding this comment

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

What kind of issues were you seeing here?

@lippling
Copy link
Owner Author

Choose a reason for hiding this comment

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

It was a workaround for a compiler bug (see: https://devforums.apple.com/thread/122059?tstart=15) with armv6 architecture.

@matej
Copy link

@matej matej commented on efedaeb Feb 16, 2012

Choose a reason for hiding this comment

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

Interesting. And this fixed it? Was only the origin corrupted? What about all other CGrect/CGSize returning calls? Those weren't affected by this bug?

@lippling
Copy link
Owner Author

Choose a reason for hiding this comment

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

It's a problem with calls that return CGRect/CGSize. There are probably more issues because of that. One solution is to disable thumb compiling for armv6 (use this flag: -mno-thumb - for additional information see the blog post above).

Please sign in to comment.