Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: ui/base/events/event.cc

Issue 10905163: aura-x11: Fix touch-calibration for multi-monitor setups. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ui/aura/root_window_host_linux.cc ('K') | « ui/base/events/event.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/events/event.cc
diff --git a/ui/base/events/event.cc b/ui/base/events/event.cc
index fdc40b42df159137ddc75e34bc5a985e19302fad..298ae6a73a54936bb010f30082f09e57877b3a65 100644
--- a/ui/base/events/event.cc
+++ b/ui/base/events/event.cc
@@ -291,6 +291,16 @@ TouchEvent::TouchEvent(EventType type,
TouchEvent::~TouchEvent() {
}
+void TouchEvent::CalibrateLocation(const gfx::Size& from, const gfx::Size& to) {
+ int calibrated_x = x() * to.width() / from.width();
Daniel Erat 2012/09/10 17:27:31 nit: cast to floating-point and round?
sadrul 2012/09/10 18:19:32 Done.
+ int calibrated_y = y() * to.height() / from.height();
+ location_ = gfx::Point(calibrated_x, calibrated_y);
+
+ calibrated_x = root_location().x() * to.width() / from.width();
+ calibrated_y = root_location().y() * to.height() / from.height();
+ root_location_ = gfx::Point(calibrated_x, calibrated_y);
+}
+
void TouchEvent::UpdateForRootTransform(const Transform& root_transform) {
LocatedEvent::UpdateForRootTransform(root_transform);
gfx::Point3f scale;
« ui/aura/root_window_host_linux.cc ('K') | « ui/base/events/event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698