diff options
Diffstat (limited to 'core/fpdftext/cpdf_textpage.cpp')
-rw-r--r-- | core/fpdftext/cpdf_textpage.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp index b5563bb0c5..bd60435bb1 100644 --- a/core/fpdftext/cpdf_textpage.cpp +++ b/core/fpdftext/cpdf_textpage.cpp @@ -301,8 +301,7 @@ std::vector<CFX_FloatRect> CPDF_TextPage::GetRectArray(int start, } int CPDF_TextPage::GetIndexAtPos(const CFX_PointF& point, - FX_FLOAT xTolerance, - FX_FLOAT yTolerance) const { + const CFX_SizeF& tolerance) const { if (!m_bIsParsed) return -3; @@ -315,13 +314,13 @@ int CPDF_TextPage::GetIndexAtPos(const CFX_PointF& point, CFX_FloatRect charrect = charinfo.m_CharBox; if (charrect.Contains(point)) break; - if (xTolerance > 0 || yTolerance > 0) { + if (tolerance.width > 0 || tolerance.height > 0) { CFX_FloatRect charRectExt; charrect.Normalize(); - charRectExt.left = charrect.left - xTolerance / 2; - charRectExt.right = charrect.right + xTolerance / 2; - charRectExt.top = charrect.top + yTolerance / 2; - charRectExt.bottom = charrect.bottom - yTolerance / 2; + charRectExt.left = charrect.left - tolerance.width / 2; + charRectExt.right = charrect.right + tolerance.width / 2; + charRectExt.top = charrect.top + tolerance.height / 2; + charRectExt.bottom = charrect.bottom - tolerance.height / 2; if (charRectExt.Contains(point)) { double curXdif, curYdif; curXdif = FXSYS_fabs(point.x - charrect.left) < @@ -378,14 +377,6 @@ CFX_WideString CPDF_TextPage::GetTextByRect(const CFX_FloatRect& rect) const { return strText; } -int CPDF_TextPage::GetIndexAtPos(FX_FLOAT x, - FX_FLOAT y, - FX_FLOAT xTolerance, - FX_FLOAT yTolerance) const { - CFX_PointF point(x, y); - return GetIndexAtPos(point, xTolerance, yTolerance); -} - void CPDF_TextPage::GetCharInfo(int index, FPDF_CHAR_INFO* info) const { if (!m_bIsParsed) return; |