Re: Re: Text layout responsibility
Re: Re: Text layout responsibility
- Subject: Re: Re: Text layout responsibility
- From: Rimas <email@hidden>
- Date: Fri, 12 Dec 2008 11:12:48 +0200
Hello Martin,
Thank you for your response.
> The text container isn't really responsible for that. It's job is to merely
> define the geometric space available for text. I would expect you'll find it
> easier to override NSTypesetter's
> "willSetLineFragmentRect:forGlyphRange:etc:" method.
I will check this out.
> NSLayoutManager is touchy about changing NSTextContainer geometry during
> layout, but I would expect it to be safe to do so in response to that
> notification. Are you perhaps altering the contents of your NSTextStorage in
> response to layout events/notifications? Can you post the full stack
> backtrace for the exception?
#0 0x92811e17 in objc_exception_throw
#1 0x9071bf2b in +[NSException raise:format:arguments:]
#2 0x9071bf6a in +[NSException raise:format:]
#3 0x934598cc in _NSBlockNumberForIndex
#4 0x93462baf in -[NSLayoutManager
textContainerForGlyphAtIndex:effectiveRange:]
#5 0x934629c8 in -[NSLayoutManager glyphRangeForTextContainer:]
#6 0x0026d4ab in -[MyTestController textDidChange_private:] at
MyTestController.m:2178
#7 0x0026d08d in -[MyTestController TT_TextStorageContentChanged:] at
MyTestController.m:2017
This raises after changing text view container size
([__viewTextContainer setContainerSize:NSMakeSize(MAX_SIZE,
MAX_SIZE)];), when calling [__viewLayoutManager
glyphRangeForTextContainer:__viewTextContainer];. This
(glyphRangeForTextContainer call) is required to use NSRect __realRec
= [__viewLayoutManager usedRectForTextContainer:__viewTextContainer];
Rimas M.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden