summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>1998-12-02 16:04:03 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>1998-12-02 16:04:03 +0000
commit892664ca26ebe8d03c2acd701124a9f8fcbdab5f (patch)
tree65042b9b23746497b1d5bf1346cefad575d3099a /src
parente467c3e8a93c4bd188c2f4efa4dabbb09e552b59 (diff)
WIN32 RGB color fixes from Vincent.
git-svn-id: file:///fltk/svn/fltk/trunk@115 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/fl_color_win32.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/fl_color_win32.cxx b/src/fl_color_win32.cxx
index 7b2d0e9cd..d615d2671 100644
--- a/src/fl_color_win32.cxx
+++ b/src/fl_color_win32.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_color_win32.cxx,v 1.6 1998/11/08 17:02:40 mike Exp $"
+// "$Id: fl_color_win32.cxx,v 1.7 1998/12/02 16:04:02 mike Exp $"
//
// WIN32 color functions for the Fast Light Tool Kit (FLTK).
//
@@ -47,9 +47,17 @@ Fl_XMap fl_xmap[256];
Fl_XMap* fl_current_xmap;
HPALETTE fl_palette;
+HPEN tmppen=0;
+HBRUSH tmpbrush=0;
static void clear_xmap(Fl_XMap& xmap) {
if (xmap.pen) {
+ if(!tmppen) tmppen = CreatePen(PS_SOLID, 1, 0);
+ if(!tmpbrush) tmpbrush = CreateSolidBrush(0);
+ HPEN oldpen = SelectObject(fl_gc, tmppen); // Push out the current pen of the gc
+ if(oldpen != xmap.pen) SelectObject(fl_gc, oldpen); // Put it back if it is not the one we are about to delete
+ SelectObject(fl_gc, tmpbrush); // Push out the old pen of the gc
+ //fl_current_xmap = 0;
DeleteObject((HGDIOBJ)(xmap.pen));
xmap.pen = 0;
xmap.brush = -1;
@@ -225,5 +233,5 @@ fl_select_palette(void)
#endif
//
-// End of "$Id: fl_color_win32.cxx,v 1.6 1998/11/08 17:02:40 mike Exp $".
+// End of "$Id: fl_color_win32.cxx,v 1.7 1998/12/02 16:04:02 mike Exp $".
//