NSLayoutManagerDelegate notifications and line breaks
| Originator: | SoCalledNonFlipped | ||
| Number: | rdar://12952964 | Date Originated: | 03-Jan-2013 06:30 PM |
| Status: | Open | Resolved: | |
| Product: | Mac OS X | Product Version: | 10.8 |
| Classification: | Other Bug | Reproducible: | Always |
03-Jan-2013 06:30 PM Kevin Doughty: Summary: NSLayoutManagerDelegate notifications fail to fire in the presence of line breaks. Steps to Reproduce: If the cursor is above a single line break that is below the visible rect of the clip view (by resizing the window so that it becomes narrow) there will be one last didInvalidateLayout: notification without a matching didCompleteLayout notification. Expected Results: Notifications getting sent. Actual Results: Notifications do not get sent as soon as a single line break is scrolled below the visible rect of the clip view, if the cursor is above that line break. Regression: I am unsure when this first occurred. Notes: I would love it if NSTextView and NSLayoutManager used Core Text. I have included an Xcode project, and a video called "LineBreaks.mov" in the project folder, showing two bugs. My first upload attempt failed because the video was 117.2 MB so it's a bit compressed now. 03-Jan-2013 06:30 PM Kevin Doughty: 'NSLayoutManager and line breaks.zip' was successfully uploaded 03-Jan-2013 07:13 PM Kevin Doughty: Eventually, with enough line breaks, the cursor position does not matter and notifications fail all over the place. The textContainer containerSize width that they will fail at, though, is impossible for me to predict. 21-Jan-2013 09:44 PM Kevin Doughty: I am embarrassed to admit I forgot to check backgroundLayoutEnabled and allowsNonContiguousLayout combinations. It seems that the workaround is allowsNonContiguousLayout = NO backgroundLayoutEnabled = YES, any other combination will fail. This can be accomplished by merely unchecking Non-contiguous Layout on the text view in the nib. 21-Jan-2013 10:04 PM Kevin Doughty: Another workaround, manually calling ensureLayoutForGlyphRange: in the layoutManagerDidInvalidateLayout: notification works in many but not all cases.
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!