Text system glitch - lines across text view
Text system glitch - lines across text view
- Subject: Text system glitch - lines across text view
- From: Andrew Hughes <email@hidden>
- Date: Sun, 25 Dec 2011 15:22:24 -0600
Hello all and merry christmas,
I have a text editor program that I wrote and on the whole it works very
well, but I've struggled on and off with a recurring annoying issues. Lines
are drawn across the NSTextView below where I am writing. Sometimes the
text also appears "doubled"; it looks darker and slightly larger.
http://www.cantgetnosleep.com/glitch_lines.png
This problem only seems to happen when I am in the paginated view, so it's
likely some issue in my pagination algorithm. I'm guessing it's a matter of
either calling or not calling one of the various display-refresh-related
methods but I'm not sure.
Some more background: the text system allows the user to view multiple
NSTextStorage-NSTextContainer-NSTextView systems in a single master view by
laying them out on the screen in pages. So that on a single screen you will
have a heirarchy like:
NSTextView > NSTextContainer
NSTextView > NSTextContainer > NSTextStorage
NSTextView > NSTextContainer
NSView -> NSTextView > NSTextContainer
NSTextView > NSTextContainer > NSTextStorage
NSTextView > NSTextContainer
NSTextView > NSTextContainer > NSTextStorage
NSTextView > NSTextContainer
NSTextView > NSTextContainer
NSTextView > NSTextContainer
The list of visible NSTextViews needed can get quite large, so as an
optimization the pagination algorithm starts at the currently being edited
NSTextStorage-Container-View and does that in the foreground before laying
out the rest of the system on a separate thread in the background (they are
hidden while being pushed to a separate thread).
The bug/issue typically occurs when I start hitting "return", which causes
the pagination algorithm and layout system to kick in, leaving behind the
lines and bold-looking text. It always clears if I scroll or click the
mouse over it or highlight that area.
Many thanks! Hopefully somebody can help me figure this out.
Andrew
_______________________________________________
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