summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2015-07-21 12:27:54 +0000
committerManolo Gouy <Manolo>2015-07-21 12:27:54 +0000
commit35704c82a35058a7a16bc9f6cf5a828674b46be1 (patch)
tree35cc6e46aae2e2e7e5fb00d00315ad49ba0da298 /src
parente7291b373c7f16bb5c6fa582bf5f31854013c9ad (diff)
Selected text is now displayed using a color that contrasts with the background color
(This commit is in the interest of allowing the release of FLTK 1.3.4 not to be delayed). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10804 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Text_Display.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index 255581cd5..d747b1c2c 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -2149,7 +2149,7 @@ void Fl_Text_Display::draw_string(int style,
if (Fl::focus() == (Fl_Widget*)this) background = fl_color_average(color(), selection_color(), 0.5f);
else background = fl_color_average(color(), selection_color(), 0.6f);
} else background = color();
- foreground = styleRec->color;
+ foreground = (style & PRIMARY_MASK) ? fl_contrast(styleRec->color, background) : styleRec->color;
} else if (style & PRIMARY_MASK) {
if (Fl::focus() == (Fl_Widget*)this) background = selection_color();
else background = fl_color_average(color(), selection_color(), 0.4f);