summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_transformpage.cpp
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2017-02-22 19:56:15 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-23 01:17:40 +0000
commitb147e07ee36be10ca0796a6566be107077c21a03 (patch)
tree637b1b206000a88fb3e198f648e86a9ee5178f1b /fpdfsdk/fpdf_transformpage.cpp
parente3f237740fd8bea50b4a6f37f56455dfa0328546 (diff)
downloadpdfium-b147e07ee36be10ca0796a6566be107077c21a03.tar.xz
Convert point x,y into CFX_PointF
This Cl converts the PointX,PointY pairs into a CFX_PointF. Change-Id: I46897832077c317a5bffb4e568550705decbc40c Reviewed-on: https://pdfium-review.googlesource.com/2821 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 'fpdfsdk/fpdf_transformpage.cpp')
-rw-r--r--fpdfsdk/fpdf_transformpage.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp
index 7e19505c26..3427f4ea58 100644
--- a/fpdfsdk/fpdf_transformpage.cpp
+++ b/fpdfsdk/fpdf_transformpage.cpp
@@ -239,32 +239,32 @@ void OutputPath(CFX_ByteTextBuf& buf, CPDF_Path path) {
const std::vector<FX_PATHPOINT>& pPoints = pPathData->GetPoints();
if (path.IsRect()) {
- buf << (pPoints[0].m_PointX) << " " << (pPoints[0].m_PointY) << " "
- << (pPoints[2].m_PointX - pPoints[0].m_PointX) << " "
- << (pPoints[2].m_PointY - pPoints[0].m_PointY) << " re\n";
+ CFX_PointF diff = pPoints[2].m_Point - pPoints[0].m_Point;
+ buf << pPoints[0].m_Point.x << " " << pPoints[0].m_Point.y << " " << diff.x
+ << " " << diff.y << " re\n";
return;
}
CFX_ByteString temp;
for (size_t i = 0; i < pPoints.size(); i++) {
- buf << (pPoints[i].m_PointX) << " " << (pPoints[i].m_PointY);
+ buf << pPoints[i].m_Point.x << " " << pPoints[i].m_Point.y;
FXPT_TYPE point_type = pPoints[i].m_Type;
if (point_type == FXPT_TYPE::MoveTo) {
buf << " m\n";
} else if (point_type == FXPT_TYPE::BezierTo) {
- buf << " " << (pPoints[i + 1].m_PointX) << " "
- << (pPoints[i + 1].m_PointY) << " " << (pPoints[i + 2].m_PointX)
- << " " << (pPoints[i + 2].m_PointY);
+ buf << " " << pPoints[i + 1].m_Point.x << " " << pPoints[i + 1].m_Point.y
+ << " " << pPoints[i + 2].m_Point.x << " " << pPoints[i + 2].m_Point.y;
+ buf << " c";
if (pPoints[i + 2].m_CloseFigure)
- buf << " c h\n";
- else
- buf << " c\n";
+ buf << " h";
+ buf << "\n";
+
i += 2;
} else if (point_type == FXPT_TYPE::LineTo) {
+ buf << " l";
if (pPoints[i].m_CloseFigure)
- buf << " l h\n";
- else
- buf << " l\n";
+ buf << " h";
+ buf << "\n";
}
}
}