diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-02-16 09:20:49 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-16 15:08:51 +0000 |
commit | fa42927a727aa7f7f081b40ff75d1a849c2365c3 (patch) | |
tree | 6287f47a017a7fe6986aabf4e5ad975b3ff4b67e /core/fxcrt | |
parent | a4ad01fe03ffdd1806d31a9d7bb820f6a69a0afb (diff) | |
download | pdfium-fa42927a727aa7f7f081b40ff75d1a849c2365c3.tar.xz |
Convert CPDF_TextObject to CFX_PointF
This CL converts the OriginX and OriginY from CPDF_TextObjectItem to use a
CFX_PointF instead of two floats.
Change-Id: Id39de18d3d908a86f925bec68d0680392f70906e
Reviewed-on: https://pdfium-review.googlesource.com/2715
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fxcrt')
-rw-r--r-- | core/fxcrt/fx_basic_coords.cpp | 6 | ||||
-rw-r--r-- | core/fxcrt/fx_coordinates.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/core/fxcrt/fx_basic_coords.cpp b/core/fxcrt/fx_basic_coords.cpp index 0785c7821b..ea11acab6b 100644 --- a/core/fxcrt/fx_basic_coords.cpp +++ b/core/fxcrt/fx_basic_coords.cpp @@ -373,6 +373,12 @@ void CFX_Matrix::TransformPoint(FX_FLOAT& x, FX_FLOAT& y) const { y = fy; } +CFX_PointF CFX_Matrix::Transform(const CFX_PointF& point) const { + CFX_PointF ret = point; + TransformPoint(ret.x, ret.y); + return ret; +} + void CFX_Matrix::TransformRect(CFX_RectF& rect) const { FX_FLOAT right = rect.right(), bottom = rect.bottom(); TransformRect(rect.left, right, bottom, rect.top); diff --git a/core/fxcrt/fx_coordinates.h b/core/fxcrt/fx_coordinates.h index ae09cf341e..7e7ed5264c 100644 --- a/core/fxcrt/fx_coordinates.h +++ b/core/fxcrt/fx_coordinates.h @@ -647,6 +647,7 @@ class CFX_Matrix { FX_FLOAT TransformDistance(FX_FLOAT distance) const; void TransformPoint(FX_FLOAT& x, FX_FLOAT& y) const; + CFX_PointF Transform(const CFX_PointF& point) const; void TransformRect(CFX_RectF& rect) const; void TransformRect(FX_FLOAT& left, |