summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXDraw.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2016-07-15 10:47:18 (GMT)
committerKevin Walzer <kw@codebykevin.com>2016-07-15 10:47:18 (GMT)
commit657059c544043fca33be51d893ad79cdb8941e24 (patch)
tree2709070b1ea361c2ed7993c57f868eadb0a34720 /macosx/tkMacOSXDraw.c
parentd4873b4490f6cbad7f5ef9d2b622f8ac5a6eaf7b (diff)
downloadtk-657059c544043fca33be51d893ad79cdb8941e24.zip
tk-657059c544043fca33be51d893ad79cdb8941e24.tar.gz
tk-657059c544043fca33be51d893ad79cdb8941e24.tar.bz2
Fix for image/alpha rendering under hidpi/Retina displays on Mac OS; thanks to Marc Culler for assistance
Diffstat (limited to 'macosx/tkMacOSXDraw.c')
-rw-r--r--macosx/tkMacOSXDraw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index d9b909b..f48538d 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -399,9 +399,11 @@ TkPutImage(
CGImageRef img = CreateCGImageWithXImage(image);
if (img) {
+ /* If the XImage has big pixels, rescale the source dimensions.*/
+ int pp = image->pixelpower;
DrawCGImage(d, gc, dc.context, img, gc->foreground, gc->background,
- CGRectMake(0, 0, image->width, image->height),
- CGRectMake(src_x, src_y, width, height),
+ CGRectMake(0, 0, image->width<<pp, image->height<<pp),
+ CGRectMake(src_x<<pp, src_y<<pp, width<<pp, height<<pp),
CGRectMake(dest_x, dest_y, width, height));
CFRelease(img);
} else {