diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-09 23:17:35 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-09 23:17:35 +0000 |
commit | 4b01b9680e67ba802e8a16027ffe4b4d435fc1e8 (patch) | |
tree | 675aa1ca07fa8f0d3bb1f0f4249822a6bf4e817d /ash/display | |
parent | 0c77646718f41510a03905f1ed31cd382109a6c4 (diff) | |
download | chromium_src-4b01b9680e67ba802e8a16027ffe4b4d435fc1e8.zip chromium_src-4b01b9680e67ba802e8a16027ffe4b4d435fc1e8.tar.gz chromium_src-4b01b9680e67ba802e8a16027ffe4b4d435fc1e8.tar.bz2 |
Remove implicit flooring Scale() method from Point and Size.
When scaling an integer point or size, return a floating point
result. Implicitly flooring hides design problems and bugs. Add
conversion functions to floor or ceil a SizeF or PointF
into an integer format again.
All existing behaviour has been preserved by replacing uses of
foo.Scale() with ToFlooredFoo(foo.Scale()).
R=sky
BUG=147395
Review URL: https://chromiumcodereview.appspot.com/11081007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160970 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/display')
-rw-r--r-- | ash/display/multi_display_manager.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ash/display/multi_display_manager.cc b/ash/display/multi_display_manager.cc index be5897c..ef20b0e 100644 --- a/ash/display/multi_display_manager.cc +++ b/ash/display/multi_display_manager.cc @@ -21,6 +21,7 @@ #include "ui/gfx/display.h" #include "ui/gfx/screen.h" #include "ui/gfx/rect.h" +#include "ui/gfx/size_conversions.h" #if defined(USE_X11) #include "ui/base/x/x11_util.h" @@ -406,7 +407,7 @@ void MultiDisplayManager::ScaleDisplayImpl() { float factor = display.device_scale_factor() == 1.0f ? 2.0f : 1.0f; display.SetScaleAndBounds( factor, gfx::Rect(display.bounds_in_pixel().origin(), - display.size().Scale(factor))); + gfx::ToFlooredSize(display.size().Scale(factor)))); new_displays.push_back(display); } OnNativeDisplaysChanged(new_displays); |