Commit d548530f authored by Songtao Xia's avatar Songtao Xia Committed by Commit Bot

[Overlay] Hinge Window-Viewport scale incorrectly applied

This CL fixes an issue where hinge is shifted when a user changes
screen setting. For example in Windows, when a user increases
"the size of text, apps and other items" in display setting. The
hinge is displaced.

Cause: Tools::Draw function takes a windows to view port scale. Hinge copied
the logic from HighlightQuad. It draws a quad, whose calculation
applies the scale. It really shouldn't as the hinge's geometric
parameters by px is measured not in the device world. Like the
the width and height of the device, they are measured in the
windows/chrome client world.

Fix: create the quad using a scale of 1.

Before image (annotated with the window-viewport scale and
emulation scale factor):

https://imgur.com/XCLBdRL

Hinge is shifted by window-viewport scale:1.5.

After image:
1) Same situation as above:
https://imgur.com/XUBdYvb

2) manually chosen emulation scale with scrolling and zooming:

https: //imgur.com/e2dTaIX
Change-Id: Id1237748d2f41ef5aecd8374c4457e3205d6a91d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2202121Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Reviewed-by: default avatarBrandon Goddard <brgoddar@microsoft.com>
Commit-Queue: Songtao Xia <soxia@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#774212}
parent 0f53672f
......@@ -232,7 +232,8 @@ void Hinge::Trace(Visitor* visitor) const {
}
void Hinge::Draw(float scale) {
InspectorHighlight highlight(scale);
// scaling is applied at the drawHighlight code.
InspectorHighlight highlight(1.f);
highlight.AppendQuad(quad_, content_color_, outline_color_);
overlay_->EvaluateInOverlay("drawHighlight", highlight.AsProtocolValue());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment