summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authoryoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-26 19:04:09 +0000
committeryoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-26 19:04:09 +0000
commitdc3d6dba884c14eb97eb5b7dc9fa8988b2586680 (patch)
tree7038b1f7504adf8c0295b38d069e5e979276f0e5 /ui
parent50a16812c794a968c71ec6de2baf3a203c359322 (diff)
downloadchromium_src-dc3d6dba884c14eb97eb5b7dc9fa8988b2586680.zip
chromium_src-dc3d6dba884c14eb97eb5b7dc9fa8988b2586680.tar.gz
chromium_src-dc3d6dba884c14eb97eb5b7dc9fa8988b2586680.tar.bz2
Full Screen Magnifier: Prevent the unintentional zoom origin drift on unzooming.
This fixes the unintentional zoom origin drift described at http://crbug.com/160472. Major changes: - Update the formula of calculate new position in RedrawKeepingMousePosition() - Use the float instead of integer in calculation of the position. - Add the float version of ConvertPointToDIP() in dip_util.cc BUG=160472 TEST=manual Review URL: https://chromiumcodereview.appspot.com/11348059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/compositor/dip_util.cc5
-rw-r--r--ui/compositor/dip_util.h4
2 files changed, 9 insertions, 0 deletions
diff --git a/ui/compositor/dip_util.cc b/ui/compositor/dip_util.cc
index 104a5da..1f6309a 100644
--- a/ui/compositor/dip_util.cc
+++ b/ui/compositor/dip_util.cc
@@ -29,6 +29,11 @@ gfx::Point ConvertPointToDIP(const Layer* layer,
gfx::ScalePoint(point_in_pixel, 1.0f / GetDeviceScaleFactor(layer)));
}
+gfx::PointF ConvertPointToDIP(const Layer* layer,
+ const gfx::PointF& point_in_pixel) {
+ return gfx::ScalePoint(point_in_pixel, 1.0f / GetDeviceScaleFactor(layer));
+}
+
gfx::Size ConvertSizeToDIP(const Layer* layer,
const gfx::Size& size_in_pixel) {
return gfx::ToFlooredSize(
diff --git a/ui/compositor/dip_util.h b/ui/compositor/dip_util.h
index d793dc7..e8d0367 100644
--- a/ui/compositor/dip_util.h
+++ b/ui/compositor/dip_util.h
@@ -7,6 +7,7 @@
#include "ui/compositor/compositor_export.h"
#include "base/basictypes.h"
+#include "ui/gfx/point_f.h"
namespace gfx {
class Point;
@@ -24,6 +25,9 @@ COMPOSITOR_EXPORT float GetDeviceScaleFactor(const Layer* layer);
COMPOSITOR_EXPORT gfx::Point ConvertPointToDIP(
const Layer* layer,
const gfx::Point& point_in_pixel);
+COMPOSITOR_EXPORT gfx::PointF ConvertPointToDIP(
+ const Layer* layer,
+ const gfx::PointF& point_in_pixel);
COMPOSITOR_EXPORT gfx::Size ConvertSizeToDIP(
const Layer* layer,
const gfx::Size& size_in_pixel);