Title: [219891] trunk/Source/WebCore
Revision
219891
Author
pvol...@apple.com
Date
2017-07-25 15:48:56 -0700 (Tue, 25 Jul 2017)

Log Message

Dragged links are blurry on 1x displays.
https://bugs.webkit.org/show_bug.cgi?id=174831
<rdar://problem/33519698>

Reviewed by Simon Fraser.

When the width and height of the drag image is a multiple of 2, the drag image is not blurry
on a 1x display. This is a workaround which should be removed when <rdar://problem/33059739>
is fixed.

No new tests, since this is not straightforward to test with a layout test.

* platform/mac/DragImageMac.mm:
(WebCore::LinkImageLayout::LinkImageLayout):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (219890 => 219891)


--- trunk/Source/WebCore/ChangeLog	2017-07-25 21:49:35 UTC (rev 219890)
+++ trunk/Source/WebCore/ChangeLog	2017-07-25 22:48:56 UTC (rev 219891)
@@ -1,3 +1,20 @@
+2017-07-25  Per Arne Vollan  <pvol...@apple.com>
+
+        Dragged links are blurry on 1x displays.
+        https://bugs.webkit.org/show_bug.cgi?id=174831
+        <rdar://problem/33519698>
+
+        Reviewed by Simon Fraser.
+
+        When the width and height of the drag image is a multiple of 2, the drag image is not blurry
+        on a 1x display. This is a workaround which should be removed when <rdar://problem/33059739>
+        is fixed.
+
+        No new tests, since this is not straightforward to test with a layout test.
+
+        * platform/mac/DragImageMac.mm:
+        (WebCore::LinkImageLayout::LinkImageLayout):
+
 2017-07-25  Matt Baker  <mattba...@apple.com>
 
         Web Inspector: Refactoring: extract async stack trace logic from InspectorInstrumentation

Modified: trunk/Source/WebCore/platform/mac/DragImageMac.mm (219890 => 219891)


--- trunk/Source/WebCore/platform/mac/DragImageMac.mm	2017-07-25 21:49:35 UTC (rev 219890)
+++ trunk/Source/WebCore/platform/mac/DragImageMac.mm	2017-07-25 22:48:56 UTC (rev 219891)
@@ -286,6 +286,11 @@
     currentY += linkImagePadding;
 
     boundingRect = FloatRect(0, 0, maximumUsedTextWidth + linkImagePadding * 2, currentY);
+
+    // To work around blurry drag images on 1x displays, make the width and height a multiple of 2.
+    // FIXME: remove this workaround when <rdar://problem/33059739> is fixed.
+    boundingRect.setWidth((static_cast<int>(boundingRect.width()) / 2) * 2);
+    boundingRect.setHeight((static_cast<int>(boundingRect.height() / 2) * 2));
 }
 
 DragImageRef createDragImageForLink(Element&, URL& url, const String& title, TextIndicatorData&, FontRenderingMode, float)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to