line spacing differences between NSTextView and NSAttributedString
line spacing differences between NSTextView and NSAttributedString
- Subject: line spacing differences between NSTextView and NSAttributedString
- From: Chris Eplett <email@hidden>
- Date: Tue, 28 Feb 2006 16:06:44 -0500
Hi all,
I've got an NSAttributedString that I'm drawing using the drawInRect
method in my view. Now, the user can edit this string by double
clicking it. When they do so, I stop drawing the text, then position
and show an NSTextView that has been populated with the
NSAttributedString using [[view textStorage]
setAttributedString:str]. When they click elsewhere, the contents of
the NSTextView are transferred back to my NSAttributedString, and I
hide the NSTextView and start drawing the string again.
Functionally, this all works like a charm. There is a problem,
however, in that the line spacing is not the same when the text view
draws it versus when I draw it w/ drawInRect.
The drawInRect method spaces the lines slightly further apart than
NSTextView does, so the user sees an accordion effect as the text
becomes editable.
I've tried explicitly setting the line spacing to 0 using
NSParagraphStyle, to no avail.
Any thoughts on how I can get NSTextView and NSAttributedString's
drawInRect methods to render the text with the same metrics?
Thanks in advance!
Chris Eplett
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden