diff options
| author | Manolo Gouy <Manolo> | 2016-02-15 17:21:23 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-02-15 17:21:23 +0000 |
| commit | 88f20cfd15237f150a4cb97bce5cd64b7a81a572 (patch) | |
| tree | 57b427e5f98b91031bbd4507940b9c03868ed0c8 /src/drivers | |
| parent | 5918384879521e6287e43688cb9fe480e5d29c29 (diff) | |
Improve image drawing to double-resolution Fl_Image_Surface objects (Mac OS only).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11180 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx | 2 | ||||
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx index f97dabf04..e1fa62e42 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx @@ -338,7 +338,7 @@ void Fl_Quartz_Graphics_Driver::draw_CGImage(CGImageRef cgimg, int x, int y, int } else if (at.a == 0.5) { doit = true; if (Fl_Display_Device::high_resolution()) { // make .tx and .ty have int or half-int values - deltax = (at.tx*2 - round(at.tx*2)); + deltax = -(at.tx*2 - round(at.tx*2)); deltay = (at.ty*2 - round(at.ty*2)); } else { // make .tx and .ty have integral values deltax = (at.tx - round(at.tx))*2; diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx index aa84d7777..e0a3a50ee 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx @@ -281,10 +281,11 @@ void Fl_Quartz_Graphics_Driver::restore_clip() { if ( ! fl_window ) { // a bitmap context CGFloat hgt = CGBitmapContextGetHeight(fl_gc); CGAffineTransform at = CGContextGetCTM(fl_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; - } - CGContextTranslateCTM(fl_gc, 0.5, hgt-0.5f); + offset /= at.a; } + CGContextTranslateCTM(fl_gc, offset, hgt-offset); CGContextScaleCTM(fl_gc, 1.0f, -1.0f); // now 0,0 is top-left point of the context } color(color()); |
