Re: Add overflow indicator to text
Graham Cox
This is what we do in a drawing app, which works well for us. When the text box is selected, it shows the + symbol as part of the frame. If not selected that’s not visible, so the text itself isn’t modified by not fitting. If you have some sort of highlighting or frame around the text, something like this could work for you. To detect whether this is drawn or not, we ask the layout manager of the text system for the -glyphRangeForTextContainer:, and compare it to the -glyphRangeForCharacterRange: for the entire text. The symbol is displayed when they are unequal. This is simple and reliable, though NSLayoutManagerDelegate has -layoutManager:didCompleteLayoutForTextContainer:atEnd: where the atEnd: part tells you whether it completed the job. —Graham
On 10 Nov 2017, at 4:41 am, Steve Mills <sjmills@...> wrote:
|
|