diff options
| author | Manolo Gouy <Manolo> | 2016-02-18 16:21:51 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-02-18 16:21:51 +0000 |
| commit | f33b45f1d30653fb5da4817089e38ff0a2413cfb (patch) | |
| tree | 9edc759690defa581b00b6ada80bb334f4ac5da8 /src/drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx | |
| parent | 6ce27012a9412c4964e0ae40c81ea92ff39a61d3 (diff) | |
Remove all uses of the fl_gc global variable. Towards a clean driver model.
fl_gc remains usable by the application as a hook into the system.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11189 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx')
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx index 892baf859..4b1a164df 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx @@ -30,42 +30,42 @@ void Fl_Quartz_Graphics_Driver::arc(int x,int y,int w,int h,double a1,double a2) if (w <= 0 || h <= 0) return; a1 = (-a1)/180.0f*M_PI; a2 = (-a2)/180.0f*M_PI; float cx = x + 0.5f*w - 0.5f, cy = y + 0.5f*h - 0.5f; - CGContextSetShouldAntialias(fl_gc, true); + CGContextSetShouldAntialias(gc, true); if (w!=h) { - CGContextSaveGState(fl_gc); - CGContextTranslateCTM(fl_gc, cx, cy); - CGContextScaleCTM(fl_gc, w-1.0f, h-1.0f); - CGContextAddArc(fl_gc, 0, 0, 0.5, a1, a2, 1); - CGContextRestoreGState(fl_gc); + CGContextSaveGState(gc); + CGContextTranslateCTM(gc, cx, cy); + CGContextScaleCTM(gc, w-1.0f, h-1.0f); + CGContextAddArc(gc, 0, 0, 0.5, a1, a2, 1); + CGContextRestoreGState(gc); } else { float r = (w+h)*0.25f-0.5f; - CGContextAddArc(fl_gc, cx, cy, r, a1, a2, 1); + CGContextAddArc(gc, cx, cy, r, a1, a2, 1); } - CGContextStrokePath(fl_gc); - CGContextSetShouldAntialias(fl_gc, false); + CGContextStrokePath(gc); + CGContextSetShouldAntialias(gc, false); } void Fl_Quartz_Graphics_Driver::pie(int x,int y,int w,int h,double a1,double a2) { if (w <= 0 || h <= 0) return; a1 = (-a1)/180.0f*M_PI; a2 = (-a2)/180.0f*M_PI; float cx = x + 0.5f*w - 0.5f, cy = y + 0.5f*h - 0.5f; - CGContextSetShouldAntialias(fl_gc, true); + CGContextSetShouldAntialias(gc, true); if (w!=h) { - CGContextSaveGState(fl_gc); - CGContextTranslateCTM(fl_gc, cx, cy); - CGContextScaleCTM(fl_gc, w, h); - CGContextAddArc(fl_gc, 0, 0, 0.5, a1, a2, 1); - CGContextAddLineToPoint(fl_gc, 0, 0); - CGContextClosePath(fl_gc); - CGContextRestoreGState(fl_gc); + CGContextSaveGState(gc); + CGContextTranslateCTM(gc, cx, cy); + CGContextScaleCTM(gc, w, h); + CGContextAddArc(gc, 0, 0, 0.5, a1, a2, 1); + CGContextAddLineToPoint(gc, 0, 0); + CGContextClosePath(gc); + CGContextRestoreGState(gc); } else { float r = (w+h)*0.25f; - CGContextAddArc(fl_gc, cx, cy, r, a1, a2, 1); - CGContextAddLineToPoint(fl_gc, cx, cy); - CGContextClosePath(fl_gc); + CGContextAddArc(gc, cx, cy, r, a1, a2, 1); + CGContextAddLineToPoint(gc, cx, cy); + CGContextClosePath(gc); } - CGContextFillPath(fl_gc); - CGContextSetShouldAntialias(fl_gc, false); + CGContextFillPath(gc); + CGContextSetShouldAntialias(gc, false); } #endif // FL_CFG_GFX_QUARTZ |
