[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fix: NSTextView, -drawRect:
From: |
Georg Fleischmann |
Subject: |
Re: Fix: NSTextView, -drawRect: |
Date: |
Sat, 15 Sep 2001 18:49:32 +0200 |
Hi Fred,
seems that I missed this issue before.
> I will have to reject the changes you suggest for NSTextView the same as
> I did some time ago for a similar change by Ludovic. Here is the mail I
> did send at that time to Ludovic:
Hmm, I'm still sure that my patch from July does the right thing.
I have compared the results of boundingRectForGlyphRange with the results on
OpenStep to make sure that I did it right. But, I agree that this triggered the
redraw problem:
There was this inversion of the glyph width (rect1.size.width = width -
rect1.origin.x) in boundingRectForGlyphRange, which (in most cases) accidently
increased the glyph width, and thus made the rectangle sufficient big for
deleting the background of deleted characters. Anyway, this wasn't correct.
Now, the glyph bounds are calculated correctly, but when deleting a character,
the glyph bounds (in drawRect) do not include the deleted character(s) any
more.
The only place where the glyph bounds of a deleted range are known is before
deleting the characters (as far as I can see).
As the delete methods doesn't seem to be the right place for a redraw, maybe
the affected glyph bounds (before delete) should be remembered, until the next
call of drawRect? Then the optimal area could be redrawn.
What do you think?
Georg