Title: [240044] trunk/Source/WebCore
Revision
240044
Author
drou...@apple.com
Date
2019-01-16 11:56:34 -0800 (Wed, 16 Jan 2019)

Log Message

Web Inspector: extend overlay element bounds lines to the right/below as well
https://bugs.webkit.org/show_bug.cgi?id=193336

Reviewed by Matt Baker.

This patch is purely a visual change for WebInspector, and doesn't affect anything else.

* inspector/InspectorOverlayPage.js:
(_drawBounds):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (240043 => 240044)


--- trunk/Source/WebCore/ChangeLog	2019-01-16 19:08:21 UTC (rev 240043)
+++ trunk/Source/WebCore/ChangeLog	2019-01-16 19:56:34 UTC (rev 240044)
@@ -1,3 +1,15 @@
+2019-01-16  Devin Rousso  <drou...@apple.com>
+
+        Web Inspector: extend overlay element bounds lines to the right/below as well
+        https://bugs.webkit.org/show_bug.cgi?id=193336
+
+        Reviewed by Matt Baker.
+
+        This patch is purely a visual change for WebInspector, and doesn't affect anything else.
+
+        * inspector/InspectorOverlayPage.js:
+        (_drawBounds):
+
 2019-01-16  Youenn Fablet  <you...@apple.com>
 
         Prevent WorkerRunLoop::runInMode from spinning in nested cases

Modified: trunk/Source/WebCore/inspector/InspectorOverlayPage.js (240043 => 240044)


--- trunk/Source/WebCore/inspector/InspectorOverlayPage.js	2019-01-16 19:08:21 UTC (rev 240043)
+++ trunk/Source/WebCore/inspector/InspectorOverlayPage.js	2019-01-16 19:56:34 UTC (rev 240044)
@@ -426,27 +426,45 @@
 function _drawBounds(bounds)
 {
     _isolateActions(() => {
-        let startX = DATA.contentInset.width;
-        let startY = DATA.contentInset.height;
+        let minX = DATA.contentInset.width;
+        let maxX = DATA.viewportSize.width;
+        let minY = DATA.contentInset.height;
+        let maxY = DATA.viewportSize.height;
 
         context.beginPath();
 
-        if (bounds.minY - startY > 0) {
+        if (bounds.minY > minY) {
             context.moveTo(bounds.minX, bounds.minY);
-            context.lineTo(bounds.minX, startY);
+            context.lineTo(bounds.minX, minY);
 
             context.moveTo(bounds.maxX, bounds.minY);
-            context.lineTo(bounds.maxX, startY);
+            context.lineTo(bounds.maxX, minY);
         }
 
-        if (bounds.minX - startX > 0) {
+        if (bounds.maxY < maxY) {
+            context.moveTo(bounds.minX, bounds.maxY);
+            context.lineTo(bounds.minX, maxY);
+
+            context.moveTo(bounds.maxX, bounds.maxY);
+            context.lineTo(bounds.maxX, maxY);
+        }
+
+        if (bounds.minX > minX) {
             context.moveTo(bounds.minX, bounds.minY);
-            context.lineTo(startX, bounds.minY);
+            context.lineTo(minX, bounds.minY);
 
             context.moveTo(bounds.minX, bounds.maxY);
-            context.lineTo(startX, bounds.maxY);
+            context.lineTo(minX, bounds.maxY);
         }
 
+        if (bounds.maxX < maxX) {
+            context.moveTo(bounds.maxX, bounds.minY);
+            context.lineTo(maxX, bounds.minY);
+
+            context.moveTo(bounds.maxX, bounds.maxY);
+            context.lineTo(maxX, bounds.maxY);
+        }
+
         context.lineWidth = 1;
         context.strokeStyle = boundsColor;
         context.stroke();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to