NSAttributedString boundingRectWithSize returns incorrect size with paragraph style
| Originator: | michele.titolo | ||
| Number: | rdar://16128703 | Date Originated: | 2/20/2014 |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | 7.0.3 |
| Classification: | Other Bug | Reproducible: | Always |
Summary: When using boundingRectWithSize on a NSAttributedString with a paragraph style, it returns an incorrect size. At 70 pt font, 2340 characters do not fit in 86 x 83. Steps to Reproduce: 1. Build and Run the sample app attached 2. Tap "Run" on the screen, app will log results of calculation to console. Note the size of this box. The trimmed string will not fully display in that area at the given font size (70). 3. Toggle the switch to remove the paragraph style 4. Tap "Run" again, app will log reasonable result to console (string length 10) Expected Results: I expect these calculations to be roughly the same with or without a paragraph style. Actual Results: Applying a paragraph style drastically alters the calculation of boundingRectWithSize Attachment: https://github.com/mtitolo/RectBug
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!