Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2312)

Unified Diff: core/src/fpdftext/fpdf_text_int.cpp

Issue 814303003: Transform font size to user space for valid text size comparison. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@2214
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdftext/fpdf_text_int.cpp
diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp
index 5b174f0187bf523fe77675d86854f0856b4e25ae..bbb38b4af08a74a05e234da0260f8964e3d66bba 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698