summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_texteditengine_unittest.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-04-19 21:59:43 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-19 21:59:43 +0000
commit901f343328236cdb307c354d56a454c7c62f7ec3 (patch)
tree6044b9727a3b1db8e4910aef13609f97aec2727b /xfa/fde/cfde_texteditengine_unittest.cpp
parentc831580e1b4547d5fcbe74864e657c1c4ebffc12 (diff)
downloadpdfium-901f343328236cdb307c354d56a454c7c62f7ec3.tar.xz
Caret moves after clicked char if closer to its right rect boundary.chromium/3401
Bug: chromium:832293 Change-Id: Idd240010a5ec99b836d9cb90c4c2aa3027ff5f67 Reviewed-on: https://pdfium-review.googlesource.com/31013 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_texteditengine_unittest.cpp')
-rw-r--r--xfa/fde/cfde_texteditengine_unittest.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/xfa/fde/cfde_texteditengine_unittest.cpp b/xfa/fde/cfde_texteditengine_unittest.cpp
index e279f8eb34..7ae001af91 100644
--- a/xfa/fde/cfde_texteditengine_unittest.cpp
+++ b/xfa/fde/cfde_texteditengine_unittest.cpp
@@ -416,6 +416,7 @@ TEST_F(CFDE_TextEditEngineTest, GetIndexForPoint) {
EXPECT_EQ(0U, engine()->GetIndexForPoint({0.0f, 0.0f}));
EXPECT_EQ(11U, engine()->GetIndexForPoint({999999.0f, 9999999.0f}));
EXPECT_EQ(11U, engine()->GetIndexForPoint({999999.0f, 0.0f}));
+ EXPECT_EQ(1U, engine()->GetIndexForPoint({5.0f, 5.0f}));
EXPECT_EQ(1U, engine()->GetIndexForPoint({10.0f, 5.0f}));
}
@@ -427,7 +428,8 @@ TEST_F(CFDE_TextEditEngineTest, GetIndexForPointMultiline) {
EXPECT_EQ(0U, engine()->GetIndexForPoint({0.0f, 0.0f}));
EXPECT_EQ(87U, engine()->GetIndexForPoint({999999.0f, 9999999.0f}));
EXPECT_EQ(12U, engine()->GetIndexForPoint({999999.0f, 0.0f}));
- EXPECT_EQ(1U, engine()->GetIndexForPoint({10.0f, 5.0f}));
+ EXPECT_EQ(1U, engine()->GetIndexForPoint({5.0f, 5.0f}));
+ EXPECT_EQ(2U, engine()->GetIndexForPoint({10.0f, 5.0f}));
}
TEST_F(CFDE_TextEditEngineTest, BoundsForWordAt) {