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

Unified Diff: ui/aura/event.cc

Issue 10175002: Fix scaling for aura::GestureEvent and aura::TouchEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
« no previous file with comments | « ui/aura/event.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/event.cc
diff --git a/ui/aura/event.cc b/ui/aura/event.cc
index 3fd6ab338f60d7f133b898236d4fa4224aeca497..637913491a987649cb946e06e4adc60c0315c9c6 100644
--- a/ui/aura/event.cc
+++ b/ui/aura/event.cc
@@ -13,6 +13,7 @@
#include "ui/aura/window.h"
#include "ui/base/keycodes/keyboard_code_conversion.h"
#include "ui/gfx/point3.h"
+#include "ui/gfx/interpolated_transform.h"
#include "ui/gfx/transform.h"
#if defined(OS_MACOSX)
@@ -280,6 +281,14 @@ TouchEvent::TouchEvent(ui::EventType type,
TouchEvent::~TouchEvent() {
}
+void TouchEvent::UpdateForRootTransform(const ui::Transform& root_transform) {
+ LocatedEvent::UpdateForRootTransform(root_transform);
+ gfx::Point3f scale;
+ ui::InterpolatedTransform::FactorTRS(root_transform, NULL, NULL, &scale);
+ radius_x_ *= scale.x();
+ radius_y_ *= scale.y();
+}
+
ui::EventType TouchEvent::GetEventType() const {
return type();
}
@@ -454,6 +463,14 @@ GestureEvent::GestureEvent(const GestureEvent& model,
GestureEvent::~GestureEvent() {
}
+void GestureEvent::UpdateForRootTransform(const ui::Transform& root_transform) {
+ LocatedEvent::UpdateForRootTransform(root_transform);
+ gfx::Point3f scale;
+ ui::InterpolatedTransform::FactorTRS(root_transform, NULL, NULL, &scale);
+ delta_x_ *= scale.x();
+ delta_y_ *= scale.y();
sadrul 2012/04/22 19:35:55 Are you sure the change here is necessary? The pin
pkotwicz 2012/04/23 00:15:40 You are right that UpdateForRootTransform is never
sadrul 2012/04/23 01:13:51 I actually meant that the scale-factor on the root
+}
+
int GestureEvent::GetLowestTouchId() const {
if (touch_ids_bitfield_ == 0)
return -1;
« no previous file with comments | « ui/aura/event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698