diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-02-13 15:30:30 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-13 20:49:26 +0000 |
commit | da83d3a5cc09c4056310b3cf299dbbccd5c70d11 (patch) | |
tree | ab0f293986d54615da5a769d0d39aae93f9108c1 /core/fxge/apple | |
parent | f0b65545313f065790de7f91c02e5dd160753abd (diff) | |
download | pdfium-da83d3a5cc09c4056310b3cf299dbbccd5c70d11.tar.xz |
Convert Origins to points
This CL converts various OriginX, OriginY pairs into CFX_PointF objects.
Change-Id: I9141f7fc713c710b2014d4fdcdec7dc93501f844
Reviewed-on: https://pdfium-review.googlesource.com/2575
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fxge/apple')
-rw-r--r-- | core/fxge/apple/fx_apple_platform.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/fxge/apple/fx_apple_platform.cpp b/core/fxge/apple/fx_apple_platform.cpp index d6867384e6..3713450377 100644 --- a/core/fxge/apple/fx_apple_platform.cpp +++ b/core/fxge/apple/fx_apple_platform.cpp @@ -39,9 +39,7 @@ bool CGDrawGlyphRun(CGContextRef pContext, if (bNegSize) font_size = -font_size; - FX_FLOAT ori_x = pCharPos[0].m_OriginX, ori_y = pCharPos[0].m_OriginY; CFX_Matrix new_matrix; - new_matrix.TransformPoint(ori_x, ori_y); if (pObject2Device) new_matrix.Concat(*pObject2Device); @@ -57,17 +55,20 @@ bool CGDrawGlyphRun(CGContextRef pContext, if (!pFont->GetPlatformFont()) return false; } + CFX_FixedBufGrow<uint16_t, 32> glyph_indices(nChars); CFX_FixedBufGrow<CGPoint, 32> glyph_positions(nChars); for (int i = 0; i < nChars; i++) { glyph_indices[i] = pCharPos[i].m_ExtGID ? pCharPos[i].m_ExtGID : pCharPos[i].m_GlyphIndex; + if (bNegSize) - glyph_positions[i].x = -pCharPos[i].m_OriginX; + glyph_positions[i].x = -pCharPos[i].m_Origin.x; else - glyph_positions[i].x = pCharPos[i].m_OriginX; - glyph_positions[i].y = pCharPos[i].m_OriginY; + glyph_positions[i].x = pCharPos[i].m_Origin.x; + glyph_positions[i].y = pCharPos[i].m_Origin.y; } + if (bNegSize) { new_matrix.a = -new_matrix.a; new_matrix.c = -new_matrix.c; |