From 2c02faed1da2375a91c7f9c003beb606a0611074 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 16 Feb 2017 13:42:11 -0500 Subject: Change FXTEXT_CHARPOS to use CFX_PointF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL updates the Origin x,y coordinates in FXTEXT_CHARPOS to be an CFX_PointF. Change-Id: I67281db2cb82687e12490145f7c99aee908e5fa8 Reviewed-on: https://pdfium-review.googlesource.com/2718 Commit-Queue: dsinclair Reviewed-by: Nicolás Peña --- core/fxge/ge/cfx_renderdevice.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'core/fxge/ge') diff --git a/core/fxge/ge/cfx_renderdevice.cpp b/core/fxge/ge/cfx_renderdevice.cpp index d2c677ecc2..f2bf48912c 100644 --- a/core/fxge/ge/cfx_renderdevice.cpp +++ b/core/fxge/ge/cfx_renderdevice.cpp @@ -346,6 +346,21 @@ bool ShouldDrawDeviceText(const CFX_Font* pFont, uint32_t text_flags) { } // namespace +FXTEXT_CHARPOS::FXTEXT_CHARPOS() + : m_GlyphIndex(0), + m_FontCharWidth(0), +#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ + m_ExtGID(0), +#endif + m_FallbackFontPosition(0), + m_bGlyphAdjust(false), + m_bFontStyle(false) { +} + +FXTEXT_CHARPOS::FXTEXT_CHARPOS(const FXTEXT_CHARPOS&) = default; + +FXTEXT_CHARPOS::~FXTEXT_CHARPOS(){}; + CFX_RenderDevice::CFX_RenderDevice() : m_pBitmap(nullptr), m_Width(0), @@ -912,8 +927,9 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, for (size_t i = 0; i < glyphs.size(); ++i) { FXTEXT_GLYPHPOS& glyph = glyphs[i]; const FXTEXT_CHARPOS& charpos = pCharPos[i]; - glyph.m_fOriginX = charpos.m_OriginX; - glyph.m_fOriginY = charpos.m_OriginY; + glyph.m_fOriginX = charpos.m_Origin.x; + glyph.m_fOriginY = charpos.m_Origin.y; + text2Device.TransformPoint(glyph.m_fOriginX, glyph.m_fOriginY); if (anti_alias < FXFT_RENDER_MODE_LCD) glyph.m_OriginX = FXSYS_round(glyph.m_fOriginX); @@ -1069,8 +1085,8 @@ bool CFX_RenderDevice::DrawTextPath(int nChars, charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0); } - matrix.Concat(CFX_Matrix(font_size, 0, 0, font_size, charpos.m_OriginX, - charpos.m_OriginY)); + matrix.Concat(CFX_Matrix(font_size, 0, 0, font_size, charpos.m_Origin.x, + charpos.m_Origin.y)); const CFX_PathData* pPath = pFont->LoadGlyphPath(charpos.m_GlyphIndex, charpos.m_FontCharWidth); if (!pPath) -- cgit v1.2.3