Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorOverlayPage.html

Issue 2108803006: Fix inspector overlay when use-zoom-for-dsf is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unnecessary include Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/inspector/InspectorOverlayPage.html
diff --git a/third_party/WebKit/Source/core/inspector/InspectorOverlayPage.html b/third_party/WebKit/Source/core/inspector/InspectorOverlayPage.html
index f7812443a3674e6df6b393ac781419f9b3e58fea..7189aed09d8db705a8a3cbbba6c9bae5181c7884 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorOverlayPage.html
+++ b/third_party/WebKit/Source/core/inspector/InspectorOverlayPage.html
@@ -853,7 +853,7 @@ function _drawRulers(context, bounds, rulerAtRight, rulerAtBottom)
context.restore();
}
-function drawPath(context, commands, fillColor, outlineColor, bounds)
+function drawPath(context, commands, fillColor, outlineColor, bounds, windowToViewportScale)
{
var commandsIndex = 0;
@@ -862,11 +862,12 @@ function drawPath(context, commands, fillColor, outlineColor, bounds)
var points = [];
for (var i = 0; i < count; ++i) {
- var x = Math.round(commands[commandsIndex++]);
+ // Scale down the coords by dsf ratio in use-zoom-for-dsf
+ var x = Math.round(commands[commandsIndex++] / windowToViewportScale);
bounds.maxX = Math.max(bounds.maxX, x);
bounds.minX = Math.min(bounds.minX, x);
- var y = Math.round(commands[commandsIndex++]);
+ var y = Math.round(commands[commandsIndex++] / windowToViewportScale);
bounds.maxY = Math.max(bounds.maxY, y);
bounds.minY = Math.min(bounds.minY, y);
@@ -940,11 +941,11 @@ function drawHighlight(highlight, context)
for (var paths = highlight.paths.slice(); paths.length;) {
var path = paths.pop();
- drawPath(context, path.path, path.fillColor, path.outlineColor, bounds);
+ drawPath(context, path.path, path.fillColor, path.outlineColor, bounds, highlight.windowToViewportScale);
if (paths.length) {
context.save();
context.globalCompositeOperation = "destination-out";
- drawPath(context, paths[paths.length - 1].path, "red", null, bounds);
+ drawPath(context, paths[paths.length - 1].path, "red", null, bounds, highlight.windowToViewportScale);
context.restore();
}
}

Powered by Google App Engine
This is Rietveld 408576698