Skip navigation.
 
mlRe: Rounded selection rectangles in NSTextView (was: NSBezierPath geometry question...)
FROM : Jonathon Mah
DATE : Wed Apr 13 21:27:46 2005

On 14 Apr 2005, at 03:36, Keith Blount wrote:

> Many thanks for your reply and your offer of experimenting with the
> code - much appreciated.


I saw the screenshot and was intrigued. :) I "cleaned up" (to me) the
code a bit, added a few comments, and reworked a few things.

This:correctly handles character ranges that break across two lines (see
line 49), and also the jaggy bit in "Immediately" (third paragraph in
sample text) (see line 147).

I think somewhere along the line I picked up something that made the
top and bottom corners even. But I'm not positive about this.

In the test case, there is a bug where if you change the size of some
text in the middle of a block of bold text, the bubble will be drawn
twice. This is (from what I can see) a result of using
NSFontAttributeName to decide which text to put a bubble around, and if
you use your own attribute it will go away (I think).

So I think that's all the bugs fixed, that I can see. The other thing I
want to do is optimize the setNeedsDisplayInRect:avoidAdditionalLayout:
method, because at the moment it's redrawing the entire text view very
often. To see this, turn on screen updates in Quartz Debug and select a
line in, say, Xcode, then select a line in the bubble app. I'll give
that a shot in a sec.


Jonathon Mah
<email_removed>

Related mailsAuthorDate
mlRounded selection rectangles in NSTextView (was: NSBezierPath geometry question...) Keith Blount Apr 13, 20:06
mlRe: Rounded selection rectangles in NSTextView (was: NSBezierPath geometry question...) Jonathon Mah Apr 13, 21:27
mlRe: Rounded selection rectangles in NSTextView (was: NSBezierPath geometry question...) Jonathon Mah Apr 13, 21:31
mlRe: Rounded selection rectangles in NSTextView (was: NSBezierPath geometry question...) Keith Blount Apr 13, 22:23
mlRe: Rounded selection rectangles in NSTextView (was: NSBezierPath geometry question...) Keith Blount Apr 13, 22:43