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

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: remove SizeOfVector 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..57cf5b6f76ba61c51ed424f2e671a597ec84bdf1 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.DistanceFrom(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));
ui::MouseEvent mouseev(event_type, move_point, move_point, flags_);
Dispatch(mouseev);
}

Powered by Google App Engine
This is Rietveld 408576698