diff options
author | Lei Zhang <thestig@chromium.org> | 2015-01-07 23:50:22 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-01-07 23:50:22 -0800 |
commit | 12e9c8c8b577eb8de6b600b5f19d8b1dec411f77 (patch) | |
tree | c2d4d79a515cca1228e9d1c427fb85f9ef37bc14 | |
parent | ef8fb8c4c3ab9b93421389b8399fce3923ead735 (diff) | |
download | pdfium-12e9c8c8b577eb8de6b600b5f19d8b1dec411f77.tar.xz |
Transform font size to user space for valid text size comparison.chromium/2214
BUG=438441
https://codereview.chromium.org/816153002
(Manual merge of commit a09d50d09259bd90c865e92026a69f5434678e71)
Review URL: https://codereview.chromium.org/814303003
-rw-r--r-- | core/src/fpdftext/fpdf_text_int.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp index 5b174f0187..bbb38b4af0 100644 --- a/core/src/fpdftext/fpdf_text_int.cpp +++ b/core/src/fpdftext/fpdf_text_int.cpp @@ -1844,13 +1844,14 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) int nTotal = wstrItem.GetLength(); int n = 0; FX_BOOL bDel = FALSE; + FX_FLOAT threshold = charinfo.m_Matrix.TransformXDistance((FX_FLOAT)TEXT_CHARRATIO_GAPDELTA * pTextObj->GetFontSize()); while (n < m_TempCharList.GetSize() && n < 7) { n++; PAGECHAR_INFO* charinfo1 = (PAGECHAR_INFO*)m_TempCharList.GetAt(m_TempCharList.GetSize() - n); if(charinfo1->m_CharCode == charinfo.m_CharCode && charinfo1->m_pTextObj->GetFont() == charinfo.m_pTextObj->GetFont() && - FXSYS_fabs(charinfo1->m_OriginX - charinfo.m_OriginX) < TEXT_CHARRATIO_GAPDELTA * pTextObj->GetFontSize() && - FXSYS_fabs(charinfo1->m_OriginY - charinfo.m_OriginY) < TEXT_CHARRATIO_GAPDELTA * pTextObj->GetFontSize() ) { + FXSYS_fabs(charinfo1->m_OriginX - charinfo.m_OriginX) < threshold && + FXSYS_fabs(charinfo1->m_OriginY - charinfo.m_OriginY) < threshold) { bDel = TRUE; break; } |