From 7cabaf136b2aa671768c9d8ee3645c9444afc700 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 4 Oct 2018 21:13:59 +0000 Subject: CPDF_VariableText::m_nHorzScale is always 100 Remove the member and simplify logic in all the places this is passed. Change-Id: I39b979793fe84f0dc460261223655dd7f50555cc Reviewed-on: https://pdfium-review.googlesource.com/c/43474 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- core/fpdfdoc/cpdf_variabletext.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'core/fpdfdoc/cpdf_variabletext.cpp') diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp index 994a7a184f..fea74445d9 100644 --- a/core/fpdfdoc/cpdf_variabletext.cpp +++ b/core/fpdfdoc/cpdf_variabletext.cpp @@ -24,7 +24,6 @@ namespace { const float kFontScale = 0.001f; const uint8_t kReturnLength = 1; -const float kScalePercent = 0.01f; const uint8_t gFontSizeSteps[] = {4, 6, 8, 9, 10, 12, 14, 18, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, @@ -600,19 +599,15 @@ float CPDF_VariableText::GetWordWidth(int32_t nFontIndex, uint16_t Word, uint16_t SubWord, float fCharSpace, - int32_t nHorzScale, float fFontSize, float fWordTail) { - return (GetCharWidth(nFontIndex, Word, SubWord) * fFontSize * kFontScale + - fCharSpace) * - nHorzScale * kScalePercent + - fWordTail; + return GetCharWidth(nFontIndex, Word, SubWord) * fFontSize * kFontScale + + fCharSpace + fWordTail; } float CPDF_VariableText::GetWordWidth(const CPVT_WordInfo& WordInfo) { return GetWordWidth(GetWordFontIndex(WordInfo), WordInfo.Word, GetSubWord(), - GetCharSpace(), GetHorzScale(), GetWordFontSize(), - WordInfo.fWordTail); + GetCharSpace(), GetWordFontSize(), WordInfo.fWordTail); } float CPDF_VariableText::GetLineAscent() { -- cgit v1.2.3