• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: finding text to be drawn in NSTextView drawRect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: finding text to be drawn in NSTextView drawRect


  • Subject: Re: finding text to be drawn in NSTextView drawRect
  • From: Andy Lee <email@hidden>
  • Date: Thu, 23 May 2002 01:49:23 -0400

At 12:31 AM -0500 5/23/02, Scott Royston wrote:
I'm currently trying to figure out the range of text that needs to be redrawn (in drawRect) in an NSTextView.
[...]
the only function I could find to get me there was characterIndexForPoint (in screen coord, no less, ugh). problem is using a point is very hit or miss. knowing that the text is left to right helps a little, because I have a better chance of 'hitting' a character down the left side of the page, but it still doesn't work very well. before I go further down this path I was hoping somebody had an easier way.

Just a stab: maybe the methods in NSLayoutManager would give you better accuracy? I see -characterIndexForGlyphIndex: and a bunch of -glyphIndexFor... methods.

I don't have deep knowledge of this stuff, but I did have to fiddle with it a while back to get precise scrolling behavior I wanted.

--Andy
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: finding text to be drawn in NSTextView drawRect
      • From: Scott Royston <email@hidden>
References: 
 >finding text to be drawn in NSTextView drawRect (From: Scott Royston <email@hidden>)

  • Prev by Date: finding text to be drawn in NSTextView drawRect
  • Next by Date: Re: File IO preventing sleep
  • Previous by thread: finding text to be drawn in NSTextView drawRect
  • Next by thread: Re: finding text to be drawn in NSTextView drawRect
  • Index(es):
    • Date
    • Thread