Skip to content

Commit

Permalink
Modify the hot points of the 2x mouse cursor for better user experience.
Browse files Browse the repository at this point in the history
BUG=479290

Review URL: https://codereview.chromium.org/1239993002

Cr-Commit-Position: refs/heads/master@{#339484}
  • Loading branch information
xdai authored and Commit bot committed Jul 20, 2015
1 parent 0710543 commit d1675a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ash/display/cursor_window_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ TEST_F(CursorWindowControllerTest, MoveToDifferentDisplay) {
EXPECT_EQ(secondary_display_id, GetCursorDisplayId());
EXPECT_EQ(ui::kCursorNull, GetCursorType());
hot_point = GetCursorHotPoint();
EXPECT_EQ("8,9", hot_point.ToString());
EXPECT_EQ("7,7", hot_point.ToString());
cursor_bounds = GetCursorWindow()->GetBoundsInScreen();
EXPECT_EQ(220, cursor_bounds.x() + hot_point.x());
EXPECT_EQ(50, cursor_bounds.y() + hot_point.y());
Expand Down
6 changes: 3 additions & 3 deletions ash/display/mirror_window_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ TEST_F(MirrorWindowControllerTest, MAYBE_MirrorCursorLocations) {
ui::test::EventGenerator generator(root);
generator.MoveMouseToInHost(10, 20);

EXPECT_EQ("8,9", test_api.GetCursorHotPoint().ToString());
EXPECT_EQ("7,7", test_api.GetCursorHotPoint().ToString());
EXPECT_EQ("10,20",
test_api.GetCursorHotPointLocationInRootWindow().ToString());

Expand Down Expand Up @@ -250,8 +250,8 @@ TEST_F(MirrorWindowControllerTest, MAYBE_MirrorCursorMoveOnEnter) {
// Check mirrored cursor's location.
test::MirrorWindowTestApi test_api;
gfx::Point hot_point = test_api.GetCursorHotPoint();
// Rotated hot point must be (25-9, 8).
EXPECT_EQ("16,8", test_api.GetCursorHotPoint().ToString());
// Rotated hot point must be (25-7, 7).
EXPECT_EQ("18,7", test_api.GetCursorHotPoint().ToString());
// New coordinates are not (200,200) because (200,200) is not the center of
// the display.
EXPECT_EQ("199,200",
Expand Down
4 changes: 2 additions & 2 deletions ui/base/cursor/cursors_aura.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ struct CursorSet {
};

const CursorData kNormalCursors[] = {
{ui::kCursorNull, IDR_AURA_CURSOR_PTR, {4, 4}, {8, 9}},
{ui::kCursorPointer, IDR_AURA_CURSOR_PTR, {4, 4}, {8, 9}},
{ui::kCursorNull, IDR_AURA_CURSOR_PTR, {4, 4}, {7, 7}},
{ui::kCursorPointer, IDR_AURA_CURSOR_PTR, {4, 4}, {7, 7}},
{ui::kCursorNoDrop, IDR_AURA_CURSOR_NO_DROP, {9, 9}, {18, 18}},
{ui::kCursorNotAllowed, IDR_AURA_CURSOR_NO_DROP, {9, 9}, {18, 18}},
{ui::kCursorCopy, IDR_AURA_CURSOR_COPY, {9, 9}, {18, 18}},
Expand Down

0 comments on commit d1675a0

Please sign in to comment.