summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.cpp18
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.h2
2 files changed, 5 insertions, 15 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index e991e456b7..8015a8df45 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -1229,16 +1229,6 @@ CPDF_Pattern* CPDF_StreamContentParser::FindPattern(const CFX_ByteString& name,
m_pCurStates->m_ParentMatrix);
}
-void CPDF_StreamContentParser::ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y) {
- m_pCurStates->m_TextMatrix.TransformPoint(x, y);
- ConvertUserSpace(x, y);
-}
-
-void CPDF_StreamContentParser::ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y) {
- m_pCurStates->m_CTM.TransformPoint(x, y);
- m_mtContentToUser.TransformPoint(x, y);
-}
-
void CPDF_StreamContentParser::AddTextObject(CFX_ByteString* pStrs,
FX_FLOAT fInitKerning,
FX_FLOAT* pKerning,
@@ -1276,9 +1266,11 @@ void CPDF_StreamContentParser::AddTextObject(CFX_ByteString* pStrs,
pCTM[3] = m_pCurStates->m_CTM.d;
}
pText->SetSegments(pStrs, pKerning, nsegs);
- pText->m_Pos = CFX_PointF(m_pCurStates->m_TextX,
- m_pCurStates->m_TextY + m_pCurStates->m_TextRise);
- ConvertTextSpace(pText->m_Pos.x, pText->m_Pos.y);
+ pText->m_Pos = m_mtContentToUser.Transform(
+ m_pCurStates->m_CTM.Transform(m_pCurStates->m_TextMatrix.Transform(
+ CFX_PointF(m_pCurStates->m_TextX,
+ m_pCurStates->m_TextY + m_pCurStates->m_TextRise))));
+
FX_FLOAT x_advance;
FX_FLOAT y_advance;
pText->CalcPositionData(&x_advance, &y_advance,
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.h b/core/fpdfapi/page/cpdf_streamcontentparser.h
index ca7ea7c106..cd41990b0a 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.h
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.h
@@ -92,8 +92,6 @@ class CPDF_StreamContentParser {
FX_FLOAT* pKerning,
int count);
- void ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y);
- void ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y);
void OnChangeTextMatrix();
void ParsePathObject();
void AddPathPoint(FX_FLOAT x, FX_FLOAT y, FXPT_TYPE type, bool close);