diff options
Diffstat (limited to 'ui/gfx/display.cc')
-rw-r--r-- | ui/gfx/display.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc index 73f33b3..7aa1241 100644 --- a/ui/gfx/display.cc +++ b/ui/gfx/display.cc @@ -11,7 +11,6 @@ #include "ui/base/ui_base_switches.h" #include "ui/base/win/dpi.h" #include "ui/gfx/insets.h" -#include "ui/gfx/point_f.h" #include "ui/gfx/size_conversions.h" namespace gfx { @@ -104,19 +103,22 @@ void Display::SetScaleAndBounds( device_scale_factor_ = device_scale_factor; } device_scale_factor_ = std::max(1.0f, device_scale_factor_); +#if defined(USE_AURA) + bounds_in_pixel_ = bounds_in_pixel; +#endif bounds_ = gfx::Rect(gfx::ToFlooredSize( gfx::ScaleSize(bounds_in_pixel.size(), 1.0f / device_scale_factor_))); UpdateWorkAreaFromInsets(insets); } void Display::SetSize(const gfx::Size& size_in_pixel) { - gfx::Point origin = bounds_.origin(); + SetScaleAndBounds( + device_scale_factor_, #if defined(USE_AURA) - gfx::PointF origin_f = origin; - origin_f.Scale(device_scale_factor_); - origin.SetPoint(origin_f.x(), origin_f.y()); + gfx::Rect(bounds_in_pixel_.origin(), size_in_pixel)); +#else + gfx::Rect(bounds_.origin(), size_in_pixel)); #endif - SetScaleAndBounds(device_scale_factor_, gfx::Rect(origin, size_in_pixel)); } void Display::UpdateWorkAreaFromInsets(const gfx::Insets& insets) { |