mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 00:00:48 +00:00
(-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:
parent
4c0d68496c
commit
5e1795f0b9
2 changed files with 11 additions and 11 deletions
|
@ -4,7 +4,7 @@
|
||||||
Fix handling of the case where the exact glyph is found during
|
Fix handling of the case where the exact glyph is found during
|
||||||
the binary search.
|
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
|
Check that a range has a background color before checking that there
|
||||||
are rectangles for it (since ranges practically always have
|
are rectangles for it (since ranges practically always have
|
||||||
rectangles, and very rarely a background color).
|
rectangles, and very rarely a background color).
|
||||||
|
|
|
@ -1188,17 +1188,17 @@ container
|
||||||
if (NSMaxRange(r) > NSMaxRange(range))
|
if (NSMaxRange(r) > NSMaxRange(range))
|
||||||
r.length = NSMaxRange(range) - r.location;
|
r.length = NSMaxRange(range) - r.location;
|
||||||
|
|
||||||
|
color = [_textStorage attribute: NSBackgroundColorAttributeName
|
||||||
|
atIndex: char_pos
|
||||||
|
effectiveRange: NULL];
|
||||||
|
if (color)
|
||||||
|
{
|
||||||
rects = [self rectArrayForGlyphRange: r
|
rects = [self rectArrayForGlyphRange: r
|
||||||
withinSelectedGlyphRange: NSMakeRange(NSNotFound, 0)
|
withinSelectedGlyphRange: NSMakeRange(NSNotFound, 0)
|
||||||
inTextContainer: textContainer
|
inTextContainer: textContainer
|
||||||
rectCount: &count];
|
rectCount: &count];
|
||||||
|
|
||||||
if (count)
|
if (count)
|
||||||
{
|
|
||||||
color = [_textStorage attribute: NSBackgroundColorAttributeName
|
|
||||||
atIndex: char_pos
|
|
||||||
effectiveRange: NULL];
|
|
||||||
if (color)
|
|
||||||
{
|
{
|
||||||
if (last_color != color)
|
if (last_color != color)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue