Reviewed by Beth Dakin and Tim Omernick
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Jul 2006 21:31:19 +0000 (21:31 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Jul 2006 21:31:19 +0000 (21:31 +0000)
        - fixed <rdar://problem/4622794> HiDPI: dragging the selection in Safari can show pixel cracks
        at non-integral scale factors

        * bridge/mac/FrameMac.mm:
        (WebCore::FrameMac::imageFromRect):
        round image rect in window coordinate space

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15348 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/bridge/mac/FrameMac.mm

index a90a805..87d5e9d 100644 (file)
@@ -1,3 +1,14 @@
+2006-07-11  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Beth Dakin and Tim Omernick
+
+        - fixed <rdar://problem/4622794> HiDPI: dragging the selection in Safari can show pixel cracks 
+        at non-integral scale factors
+
+        * bridge/mac/FrameMac.mm:
+        (WebCore::FrameMac::imageFromRect):
+        round image rect in window coordinate space
+
 2006-07-10  Darin Adler  <darin@apple.com>
 
         Reviewed by Geoff.
index fdbc41d..1aba1b9 100644 (file)
@@ -2645,6 +2645,13 @@ NSImage *FrameMac::imageFromRect(NSRect rect) const
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     
     NSRect bounds = [view bounds];
+    
+    // Round image rect size in window coordinate space to avoid pixel cracks at HiDPI (4622794)
+    rect = [view convertRect:rect toView:nil];
+    rect.size.height = roundf(rect.size.height);
+    rect.size.width = roundf(rect.size.width);
+    rect = [view convertRect:rect fromView:nil];
+    
     resultImage = [[[NSImage alloc] initWithSize:rect.size] autorelease];
 
     if (rect.size.width != 0 && rect.size.height != 0) {