From a4fba19c11941af8996c6f054b5f1f975151377d Mon Sep 17 00:00:00 2001 From: Sergii Stoian Date: Wed, 21 Feb 2007 23:47:58 +0000 Subject: [PATCH] * Source/NSLayoutManager.m: (-drawBackgroundForGlyphRange:atPoint): Use the text view's selected text attributes. Remove TODO. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24680 72102866-910b-0410-8b05-ffd578937521 --- Source/NSLayoutManager.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/NSLayoutManager.m b/Source/NSLayoutManager.m index 70a65324c..f1144f069 100644 --- a/Source/NSLayoutManager.m +++ b/Source/NSLayoutManager.m @@ -1225,6 +1225,7 @@ container NSRange r = [self glyphRangeForCharacterRange: _selected_range actualCharacterRange: NULL]; NSRange sel = r; + NSTextView *ftv; if (r.location < range.location) { @@ -1240,8 +1241,14 @@ container r.length = range.location + range.length - r.location; } - /* TODO: use the text view's selected text attributes */ - color = [NSColor selectedTextBackgroundColor]; + /* Use the text view's selected text attributes */ + if ((ftv = [self firstTextView])) + color = [[ftv selectedTextAttributes] + objectForKey:NSBackgroundColorAttributeName]; + + if (!color) + color = [NSColor selectedTextBackgroundColor]; + if (!color) return;