Fix for 8336, focus ring redrawing on top of itself. Make sure
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Apr 2006 07:18:25 +0000 (07:18 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Apr 2006 07:18:25 +0000 (07:18 +0000)
        not to include empty rects when doing the focus ring drawing, since
        that results in a draw with no clip set.

        Reviewed by adele

        * platform/mac/GraphicsContextMac.mm:
        (WebCore::GraphicsContext::drawFocusRing):

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

WebCore/ChangeLog
WebCore/platform/mac/GraphicsContextMac.mm

index 8bd03f5d7fbe906214f00e7fef6aa2536185666f..cdabb8f374a884f848c91300b3a851c48fbbe792 100644 (file)
@@ -1,3 +1,14 @@
+2006-04-24  David Hyatt  <hyatt@apple.com>
+
+        Fix for 8336, focus ring redrawing on top of itself.  Make sure
+        not to include empty rects when doing the focus ring drawing, since
+        that results in a draw with no clip set.
+
+        Reviewed by adele
+
+        * platform/mac/GraphicsContextMac.mm:
+        (WebCore::GraphicsContext::drawFocusRing):
+
 2006-04-24  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by ggaren.
index bcc1b4068bfc3dc98ca6888f270dc3dd5405f86d..2460f636d8d88cbd1193af52748b248ba5cc3f46 100644 (file)
@@ -595,9 +595,11 @@ void GraphicsContext::drawFocusRing(const Color& color)
     for (int i = 0; i < count; ++i) {
         NSRect transformedRect = [view convertRect:drawRects[i] toView:nil];
         NSRect rectToUse = NSIntersectionRect(transformedRect, transformedClipRect);
-        CGContextBeginPath(context);
-        CGContextAddPath(context, focusRingPath);
-        wkDrawFocusRing(context, *(CGRect *)&rectToUse, colorRef, radius);
+        if (!NSIsEmptyRect(rectToUse)) {
+            CGContextBeginPath(context);
+            CGContextAddPath(context, focusRingPath);
+            wkDrawFocusRing(context, *(CGRect *)&rectToUse, colorRef, radius);
+        }
     }
 
     CGColorRelease(colorRef);