diff options
Diffstat (limited to 'ui/aura/root_window.cc')
-rw-r--r-- | ui/aura/root_window.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc index 1aa78f9..729ceab 100644 --- a/ui/aura/root_window.cc +++ b/ui/aura/root_window.cc @@ -36,8 +36,8 @@ #include "ui/gfx/display.h" #include "ui/gfx/point3_f.h" #include "ui/gfx/point_conversions.h" +#include "ui/gfx/rect_conversions.h" #include "ui/gfx/screen.h" -#include "ui/gfx/size_conversions.h" using std::vector; @@ -771,6 +771,7 @@ void RootWindow::UpdateWindowSize(const gfx::Size& host_size) { bounds = ui::ConvertRectToDIP(layer(), bounds); gfx::RectF new_bounds(bounds); layer()->transform().TransformRect(&new_bounds); + // It makes little sense to scale beyond the original // resolution. DCHECK_LE(root_window_scale_, GetDeviceScaleFactor()); @@ -781,10 +782,7 @@ void RootWindow::UpdateWindowSize(const gfx::Size& host_size) { new_bounds.Scale(root_window_scale_ * root_window_scale_); // Ignore the origin because RootWindow's insets are handled by // the transform. - // Round the size because the bounds is no longer aligned to - // backing pixel when |root_window_scale_| is specified - // (850 height at 1.25 scale becomes 1062.5 for example.) - SetBounds(gfx::Rect(gfx::ToRoundedSize(new_bounds.size()))); + SetBounds(gfx::Rect(gfx::ToNearestRect(new_bounds).size())); } void RootWindow::OnWindowAddedToRootWindow(Window* attached) { |