diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index 1313c9f..a313517 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -890,7 +890,7 @@ XGetImage(
      */
     int scalefactor = 1;
     if (win && [win respondsToSelector:@selector(backingScaleFactor)]) {
-	scalefactor = ([win backingScaleFactor] == 2.0) ? 2 : 1;
+	scalefactor = ([[win backingScaleFactor] floatValue] == 2.0) ? 2 : 1;
     }
     int scaled_height = height * scalefactor;
     int scaled_width = width * scalefactor;
