Ticket #52090: patch-macosx-tkMacOSXXStubs_non-Retina.diff
File patch-macosx-tkMacOSXXStubs_non-Retina.diff, 1.0 KB (added by ballapete (Peter "Pete" Dyballa), 8 years ago) |
---|
-
macosx/tkMacOSXXStubs.c
old new 890 890 int bitmap_pad = 0; 891 891 int bytes_per_row = 4*width; 892 892 int size; 893 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 893 894 MacDrawable *macDraw = (MacDrawable *) d; 894 895 NSWindow *win = TkMacOSXDrawableWindow(d); 895 896 /* This code assumes that backing scale factors are integers. Currently 896 897 * Retina displays use a scale factor of 2.0 and normal displays use 1.0. 897 898 * We do not support any other values here. 898 899 */ 900 #endif 899 901 int scalefactor = 1; 902 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 900 903 if (win && [win respondsToSelector:@selector(backingScaleFactor)]) { 901 904 scalefactor = ([win backingScaleFactor] == 2.0) ? 2 : 1; 902 905 } 906 #endif 903 907 int scaled_height = height * scalefactor; 904 908 int scaled_width = width * scalefactor; 905 906 909 if (format == ZPixmap) { 907 910 if (width == 0 || height == 0) { 908 911 /* This happens all the time.