summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdftext_embeddertest.cpp
diff options
context:
space:
mode:
authorAndrew Weintraub <asweintraub@google.com>2017-08-11 11:36:51 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-12 00:29:04 +0000
commitd3002340caad8d688d0e4928a36e90d354a797bd (patch)
treee87182d51b22e04ae553354655a061d9d099b1b7 /fpdfsdk/fpdftext_embeddertest.cpp
parent3c03439a81731233a5410fa4ea029721c021d42c (diff)
downloadpdfium-d3002340caad8d688d0e4928a36e90d354a797bd.tar.xz
Add a new public method to get the the origin of a character.
Bug: Change-Id: I376f4af26791cd4ed04049ab179c2b39dd262725 Reviewed-on: https://pdfium-review.googlesource.com/10690 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdftext_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdftext_embeddertest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/fpdfsdk/fpdftext_embeddertest.cpp b/fpdfsdk/fpdftext_embeddertest.cpp
index 65f5734122..572368af15 100644
--- a/fpdfsdk/fpdftext_embeddertest.cpp
+++ b/fpdfsdk/fpdftext_embeddertest.cpp
@@ -71,6 +71,12 @@ TEST_F(FPDFTextEmbeddertest, Text) {
EXPECT_NEAR(49.844, bottom, 0.001);
EXPECT_NEAR(55.520, top, 0.001);
+ double x = 0.0;
+ double y = 0.0;
+ EXPECT_TRUE(FPDFText_GetCharOrigin(textpage, 4, &x, &y));
+ EXPECT_NEAR(40.664, x, 0.001);
+ EXPECT_NEAR(50.000, y, 0.001);
+
EXPECT_EQ(4, FPDFText_GetCharIndexAtPos(textpage, 42.0, 50.0, 1.0, 1.0));
EXPECT_EQ(-1, FPDFText_GetCharIndexAtPos(textpage, 0.0, 0.0, 1.0, 1.0));
EXPECT_EQ(-1, FPDFText_GetCharIndexAtPos(textpage, 199.0, 199.0, 1.0, 1.0));