diff options
| author | Manolo Gouy <Manolo> | 2016-02-13 06:25:34 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-02-13 06:25:34 +0000 |
| commit | 8deac1e6baf7a016aabd3b6cb5ccffd7f09263cd (patch) | |
| tree | 5840c10cce714610c4590a45905b2f2e4c040bd0 /src/Fl_cocoa.mm | |
| parent | df0b1dcb07b551a93868d8bd7942232dc4d6d0a8 (diff) | |
Simpler code to support drawing to high-resolution Fl_Image_Surface object.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11162 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_cocoa.mm')
| -rw-r--r-- | src/Fl_cocoa.mm | 8 |
1 files changed, 6 insertions, 2 deletions
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_(); } |
