diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Image_Surface.cxx | 21 | ||||
| -rw-r--r-- | src/Fl_cocoa.mm | 8 |
2 files changed, 6 insertions, 23 deletions
diff --git a/src/Fl_Image_Surface.cxx b/src/Fl_Image_Surface.cxx index ff4f923a2..3385d2e25 100644 --- a/src/Fl_Image_Surface.cxx +++ b/src/Fl_Image_Surface.cxx @@ -32,25 +32,6 @@ #else #endif -#ifdef __APPLE__ -class Fl_Quartz_Scaled_Graphics_Driver_ : public Fl_Quartz_Graphics_Driver { -protected: - virtual void push_clip(int x, int y, int w, int h) { - push_no_clip(); - CGContextClipToRect(fl_gc, CGRectMake(x, y, w, h)); - } - virtual void push_no_clip() { - CGContextRestoreGState(fl_gc); - CGContextSaveGState(fl_gc); - CGContextTranslateCTM(fl_gc, 0, CGBitmapContextGetHeight(fl_gc)/2); - CGContextScaleCTM(fl_gc, 1.0f, -1.0f); - } - virtual void pop_clip() { - push_no_clip(); - } -}; -#endif - const char *Fl_Image_Surface::class_id = "Fl_Image_Surface"; /** Constructor with optional high resolution. @@ -68,8 +49,6 @@ Fl_Image_Surface::Fl_Image_Surface(int w, int h, int highres) : Fl_Surface_Devic offscreen = fl_create_offscreen(highres ? 2*w : w, highres ? 2*h : h); helper = new Fl_Quartz_Flipped_Surface_(width, height); if (highres) { - delete helper->driver(); - helper->driver(new Fl_Quartz_Scaled_Graphics_Driver_); CGContextScaleCTM(offscreen, 2, 2); } driver(helper->driver()); diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 66830ab54..938771ea4 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -3310,10 +3310,14 @@ extern void fl_quartz_restore_line_style_(); void Fl_X::q_fill_context() { if (!fl_gc) return; if ( ! fl_window) { // a bitmap context - size_t hgt = CGBitmapContextGetHeight(fl_gc); + CGFloat hgt = CGBitmapContextGetHeight(fl_gc); + CGAffineTransform at = CGContextGetCTM(fl_gc); + if (at.a != 1 && at.a == at.d && at.b == 0 && at.c == 0) { // proportional scaling, no rotation + hgt /= at.a; + } CGContextTranslateCTM(fl_gc, 0.5, hgt-0.5f); CGContextScaleCTM(fl_gc, 1.0f, -1.0f); // now 0,0 is top-left point of the context - } + } fl_color(fl_graphics_driver->color()); fl_quartz_restore_line_style_(); } |
