Commit 7c032145 authored by ananta@chromium.org's avatar ananta@chromium.org

Convert insets to pixels for app windows via the Scale method in the Insets class.

This patch fixes a bug introduced with my earlier patch where in we were converting the insets to
a rect incorrectly for converting it to pixels.

This caused border artifacts for some app windows.

BUG=393930
R=sky

Review URL: https://codereview.chromium.org/394013002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283466 0039d316-1c4b-4281-b951-d872f2087c98
parent ee712f34
......@@ -75,17 +75,11 @@ void AppWindowDesktopWindowTreeHostWin::UpdateDWMFrame() {
gfx::Insets insets = app_window_->glass_frame_view()->GetGlassInsets();
// The DWM API's expect values in pixels. We need to convert from DIP to
// pixels here.
gfx::Rect insets_rect_in_pixels(insets.left(),
insets.top(),
insets.right() - insets.left(),
insets.bottom() - insets.top());
insets_rect_in_pixels = gfx::win::DIPToScreenRect(insets_rect_in_pixels);
margins.cxLeftWidth = insets_rect_in_pixels.x();
margins.cxRightWidth =
insets_rect_in_pixels.x() + insets_rect_in_pixels.width();
margins.cyBottomHeight =
insets_rect_in_pixels.y() + insets_rect_in_pixels.height();
margins.cyTopHeight = insets_rect_in_pixels.y();
insets = insets.Scale(gfx::win::GetDeviceScaleFactor());
margins.cxLeftWidth = insets.left();
margins.cxRightWidth = insets.right();
margins.cyBottomHeight = insets.bottom();
margins.cyTopHeight = insets.top();
}
DwmExtendFrameIntoClientArea(GetHWND(), &margins);
......
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