| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fgas/layout/fgas_rtfbreak.h" | 7 #include "xfa/fgas/layout/fgas_rtfbreak.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 fX -= fCharWidth; | 1310 fX -= fCharWidth; |
| 1311 } | 1311 } |
| 1312 } | 1312 } |
| 1313 if (!bEmptyChar) { | 1313 if (!bEmptyChar) { |
| 1314 CFX_PointF ptOffset; | 1314 CFX_PointF ptOffset; |
| 1315 FX_BOOL bAdjusted = FALSE; | 1315 FX_BOOL bAdjusted = FALSE; |
| 1316 if (pAdjustPos) { | 1316 if (pAdjustPos) { |
| 1317 bAdjusted = pAdjustPos(wForm, bMBCSCode, pFont, fFontSize, | 1317 bAdjusted = pAdjustPos(wForm, bMBCSCode, pFont, fFontSize, |
| 1318 bVerticalChar, ptOffset); | 1318 bVerticalChar, ptOffset); |
| 1319 } | 1319 } |
| 1320 if (!pAdjustPos && bVerticalChar && (dwProps & 0x00010000) != 0) { | 1320 if (!bAdjusted && bVerticalChar && (dwProps & 0x00010000) != 0) { |
| 1321 CFX_Rect rtBBox; | 1321 CFX_Rect rtBBox; |
| 1322 rtBBox.Reset(); | 1322 rtBBox.Reset(); |
| 1323 if (pFont->GetCharBBox(wForm, rtBBox, bMBCSCode)) { | 1323 if (pFont->GetCharBBox(wForm, rtBBox, bMBCSCode)) { |
| 1324 ptOffset.x = fFontSize * (850 - rtBBox.right()) / 1000.0f; | 1324 ptOffset.x = fFontSize * (850 - rtBBox.right()) / 1000.0f; |
| 1325 ptOffset.y = fFontSize * (1000 - rtBBox.height) / 2000.0f; | 1325 ptOffset.y = fFontSize * (1000 - rtBBox.height) / 2000.0f; |
| 1326 } | 1326 } |
| 1327 } | 1327 } |
| 1328 pCharPos->m_OriginX = fX + ptOffset.x; | 1328 pCharPos->m_OriginX = fX + ptOffset.x; |
| 1329 pCharPos->m_OriginY = fY - ptOffset.y; | 1329 pCharPos->m_OriginY = fY - ptOffset.y; |
| 1330 } | 1330 } |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1513 rtBBoxF.height = fHeight; | 1513 rtBBoxF.height = fHeight; |
| 1514 rtBBoxF.top = std::max(rtBBoxF.top, 0.0f); | 1514 rtBBoxF.top = std::max(rtBBoxF.top, 0.0f); |
| 1515 } | 1515 } |
| 1516 rtArray.SetAt(i, rtBBoxF); | 1516 rtArray.SetAt(i, rtBBoxF); |
| 1517 continue; | 1517 continue; |
| 1518 } | 1518 } |
| 1519 rtArray.SetAt(i, rect); | 1519 rtArray.SetAt(i, rect); |
| 1520 } | 1520 } |
| 1521 return iLength; | 1521 return iLength; |
| 1522 } | 1522 } |
| OLD | NEW |