Commit 74335eed authored by Nick Burris's avatar Nick Burris Committed by Commit Bot

Properly scale resize corner on high DPI displays.

The resize corner was only getting properly scaled when a scrollbar was
present, since Scrollbar::ScrollbarThickness() uses
ChromeClient::WindowToViewportScalar() to scale its thickness[1],
whereas ScrollbarTheme::ScrollbarThickness() does not[2]. This patch
properly scales the resize corner in the case where there is no
scrollbar present.

[1]
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/scroll/scrollbar.h?l=111&rcl=acee82f7b5654353a98f7b739c25d428642e8f82
[2]
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/scroll/scrollbar_theme.h?l=61&rcl=b722ee8240e66004b021a1421d548bf10367b311

Bug: 884575
Change-Id: I3a7e0b4134928ea40be625fa1f64c05ed9490620
Reviewed-on: https://chromium-review.googlesource.com/c/1474293
Commit-Queue: Nick Burris <nburris@chromium.org>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632713}
parent ed420b87
...@@ -319,7 +319,13 @@ IntRect PaintLayerScrollableArea::PaintLayerScrollableArea::CornerRect( ...@@ -319,7 +319,13 @@ IntRect PaintLayerScrollableArea::PaintLayerScrollableArea::CornerRect(
// FIXME: This isn't right. We need to know the thickness of custom // FIXME: This isn't right. We need to know the thickness of custom
// scrollbars even when they don't exist in order to set the resizer square // scrollbars even when they don't exist in order to set the resizer square
// size properly. // size properly.
horizontal_thickness = GetPageScrollbarTheme().ScrollbarThickness(); horizontal_thickness =
GetLayoutBox()
->GetDocument()
.GetPage()
->GetChromeClient()
.WindowToViewportScalar(
GetPageScrollbarTheme().ScrollbarThickness());
vertical_thickness = horizontal_thickness; vertical_thickness = horizontal_thickness;
} else if (VerticalScrollbar() && !HorizontalScrollbar()) { } else if (VerticalScrollbar() && !HorizontalScrollbar()) {
horizontal_thickness = VerticalScrollbar()->ScrollbarThickness(); horizontal_thickness = VerticalScrollbar()->ScrollbarThickness();
......
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