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

Unified Diff: ui/aura/test/event_generator.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more vector use fixes Created 8 years, 2 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
Index: ui/aura/test/event_generator.cc
diff --git a/ui/aura/test/event_generator.cc b/ui/aura/test/event_generator.cc
index a2eb897daad5d2853beaaa66c9ad3e9699591ca8..feba3d7a6ea2f75be387dabfa1fab3cd95411ca0 100644
--- a/ui/aura/test/event_generator.cc
+++ b/ui/aura/test/event_generator.cc
@@ -126,10 +126,10 @@ void EventGenerator::MoveMouseTo(const gfx::Point& point, int count) {
DCHECK_GT(count, 0);
const ui::EventType event_type = (flags_ & ui::EF_LEFT_MOUSE_BUTTON) ?
ui::ET_MOUSE_DRAGGED : ui::ET_MOUSE_MOVED;
- const gfx::Point diff = point.Subtract(current_location_);
+ const gfx::Vector2d diff = point - current_location_;
for (int i = 1; i <= count; i++) {
const gfx::Point move_point = current_location_.Add(
- gfx::Point(diff.x() / count * i, diff.y() / count * i));
+ gfx::Vector2d(diff.x() / count * i, diff.y() / count * i));
Peter Kasting 2012/10/30 01:14:14 Do you think this suggests we should support multi
danakj 2012/10/30 19:21:21 Yeh, that sounds nice. We have a Scale() method on
Peter Kasting 2012/10/30 20:24:37 You're welcome to tack Scale() -> *,/ onto the lis
danakj 2012/10/30 21:14:52 Actually, I'm less sure about this after trying it
Peter Kasting 2012/10/30 21:41:23 Commented on bug. I'll note that having operator*
danakj 2012/10/30 21:49:10 We do non-uniform scaling between different spaces
Peter Kasting 2012/10/30 21:56:35 Sure, but is it vectors you need to scale, rather
danakj 2012/10/30 21:59:34 I'm not entirely sure, since these types are going
ui::MouseEvent mouseev(event_type, move_point, move_point, flags_);
Dispatch(mouseev);
}

Powered by Google App Engine
This is Rietveld 408576698