From 01587b308d2700f23f3c5f635f42e989c380149e Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sat, 30 May 2015 13:46:59 +0000 Subject: Mac OS: allow using fl_color(r,g,b) without drawing context. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10739 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/fl_color_mac.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/fl_color_mac.cxx b/src/fl_color_mac.cxx index 52957d4d7..4699ef31d 100644 --- a/src/fl_color_mac.cxx +++ b/src/fl_color_mac.cxx @@ -63,6 +63,7 @@ void Fl_Quartz_Graphics_Driver::color(uchar r, uchar g, uchar b) { float fr = r/255.0f; float fg = g/255.0f; float fb = b/255.0f; + if (!fl_gc) return; // no context yet? We will assign the color later. CGContextSetRGBFillColor(fl_gc, fr, fg, fb, 1.0f); CGContextSetRGBStrokeColor(fl_gc, fr, fg, fb, 1.0f); } -- cgit v1.2.3