diff options
Diffstat (limited to 'src/drivers/Quartz')
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx | 13 | ||||
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx | 8 |
2 files changed, 3 insertions, 18 deletions
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx index 4bfaa39dc..2a223bb9c 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx @@ -296,19 +296,6 @@ void Fl_Quartz_Graphics_Driver::restore_clip() { CGContextRestoreGState(gc_); CGContextSaveGState(gc_); } - // FLTK has only one global graphics state. - // This copies the FLTK state into the current Quartz context - if ( ! fl_window ) { // a bitmap context - CGFloat hgt = CGBitmapContextGetHeight(gc_); - CGAffineTransform at = CGContextGetCTM(gc_); - CGFloat offset = 0.5; - if (at.a != 1 && at.a == at.d && at.b == 0 && at.c == 0) { // proportional scaling, no rotation - hgt /= at.a; - offset /= at.a; - } - CGContextTranslateCTM(gc_, offset, hgt-offset); - CGContextScaleCTM(gc_, 1.0f, -1.0f); // now 0,0 is top-left point of the context - } color(color()); quartz_restore_line_style(); if (r) { //apply program clip diff --git a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx index b31086b1f..c8d751aa1 100644 --- a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx @@ -57,9 +57,9 @@ Fl_Quartz_Image_Surface_Driver::Fl_Quartz_Image_Surface_Driver(int w, int h, int CGContextScaleCTM(offscreen, 2, 2); } CGContextSetShouldAntialias(offscreen, false); - CGContextSaveGState(offscreen); - CGContextTranslateCTM(offscreen, 0, height); + CGContextTranslateCTM(offscreen, 0, height); CGContextScaleCTM(offscreen, 1.0f, -1.0f); + CGContextSaveGState(offscreen); CGContextSetRGBFillColor(offscreen, 1, 1, 1, 0); CGContextFillRect(offscreen, CGRectMake(0,0,w,h)); } @@ -84,10 +84,8 @@ void Fl_Quartz_Image_Surface_Driver::set_current() { void Fl_Quartz_Image_Surface_Driver::translate(int x, int y) { CGContextRestoreGState(offscreen); CGContextSaveGState(offscreen); - CGContextTranslateCTM(offscreen, x, -y); + CGContextTranslateCTM(offscreen, x, y); CGContextSaveGState(offscreen); - CGContextTranslateCTM(offscreen, 0, height); - CGContextScaleCTM(offscreen, 1.0f, -1.0f); } void Fl_Quartz_Image_Surface_Driver::untranslate() { |
