(-drawBackgroundForGlyphRange:atPoint:): Check that a range has a background color before checking that there are rectangles for it.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16061 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2003-02-24 02:54:32 +00:00
parent 4c0d68496c
commit 5e1795f0b9
2 changed files with 11 additions and 11 deletions

View file

@ -4,7 +4,7 @@
Fix handling of the case where the exact glyph is found during
the binary search.
* Source/NSLayoutManager.m (-drawGlyphsForGlyphRange:atPoint:):
* Source/NSLayoutManager.m (-drawBackgroundForGlyphRange:atPoint:):
Check that a range has a background color before checking that there
are rectangles for it (since ranges practically always have
rectangles, and very rarely a background color).

View file

@ -1188,17 +1188,17 @@ container
if (NSMaxRange(r) > NSMaxRange(range))
r.length = NSMaxRange(range) - r.location;
rects = [self rectArrayForGlyphRange: r
withinSelectedGlyphRange: NSMakeRange(NSNotFound, 0)
inTextContainer: textContainer
rectCount: &count];
if (count)
color = [_textStorage attribute: NSBackgroundColorAttributeName
atIndex: char_pos
effectiveRange: NULL];
if (color)
{
color = [_textStorage attribute: NSBackgroundColorAttributeName
atIndex: char_pos
effectiveRange: NULL];
if (color)
rects = [self rectArrayForGlyphRange: r
withinSelectedGlyphRange: NSMakeRange(NSNotFound, 0)
inTextContainer: textContainer
rectCount: &count];
if (count)
{
if (last_color != color)
{