summaryrefslogtreecommitdiff
path: root/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-02-15 17:21:23 +0000
committerManolo Gouy <Manolo>2016-02-15 17:21:23 +0000
commit88f20cfd15237f150a4cb97bce5cd64b7a81a572 (patch)
tree57b427e5f98b91031bbd4507940b9c03868ed0c8 /src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx
parent5918384879521e6287e43688cb9fe480e5d29c29 (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/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx')
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx5
1 files changed, 3 insertions, 2 deletions
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());