summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdf_editpath.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/fpdfsdk/fpdf_editpath.cpp b/fpdfsdk/fpdf_editpath.cpp
index b6926a2492..d9213c8b49 100644
--- a/fpdfsdk/fpdf_editpath.cpp
+++ b/fpdfsdk/fpdf_editpath.cpp
@@ -49,7 +49,7 @@ CPDF_PathObject* CPDFPathObjectFromFPDFPageObject(FPDF_PAGEOBJECT page_object) {
FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_CreateNewPath(float x,
float y) {
auto pPathObj = pdfium::MakeUnique<CPDF_PathObject>();
- pPathObj->m_Path.AppendPoint(CFX_PointF(x, y), FXPT_TYPE::MoveTo, false);
+ pPathObj->path().AppendPoint(CFX_PointF(x, y), FXPT_TYPE::MoveTo, false);
pPathObj->DefaultStates();
// Caller takes ownership.
@@ -61,7 +61,7 @@ FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_CreateNewRect(float x,
float w,
float h) {
auto pPathObj = pdfium::MakeUnique<CPDF_PathObject>();
- pPathObj->m_Path.AppendRect(x, y, x + w, y + h);
+ pPathObj->path().AppendRect(x, y, x + w, y + h);
pPathObj->DefaultStates();
// Caller takes ownership.
@@ -131,7 +131,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPath_CountSegments(FPDF_PAGEOBJECT path) {
auto* pPathObj = CPDFPathObjectFromFPDFPageObject(path);
if (!pPathObj)
return -1;
- return pdfium::CollectionSize<int>(pPathObj->m_Path.GetPoints());
+ return pdfium::CollectionSize<int>(pPathObj->path().GetPoints());
}
FPDF_EXPORT FPDF_PATHSEGMENT FPDF_CALLCONV
@@ -140,7 +140,7 @@ FPDFPath_GetPathSegment(FPDF_PAGEOBJECT path, int index) {
if (!pPathObj)
return nullptr;
- const std::vector<FX_PATHPOINT>& points = pPathObj->m_Path.GetPoints();
+ const std::vector<FX_PATHPOINT>& points = pPathObj->path().GetPoints();
if (!pdfium::IndexInBounds(points, index))
return nullptr;
@@ -154,7 +154,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_MoveTo(FPDF_PAGEOBJECT path,
if (!pPathObj)
return false;
- pPathObj->m_Path.AppendPoint(CFX_PointF(x, y), FXPT_TYPE::MoveTo, false);
+ pPathObj->path().AppendPoint(CFX_PointF(x, y), FXPT_TYPE::MoveTo, false);
pPathObj->SetDirty(true);
return true;
}
@@ -166,7 +166,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_LineTo(FPDF_PAGEOBJECT path,
if (!pPathObj)
return false;
- pPathObj->m_Path.AppendPoint(CFX_PointF(x, y), FXPT_TYPE::LineTo, false);
+ pPathObj->path().AppendPoint(CFX_PointF(x, y), FXPT_TYPE::LineTo, false);
pPathObj->SetDirty(true);
return true;
}
@@ -182,9 +182,10 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_BezierTo(FPDF_PAGEOBJECT path,
if (!pPathObj)
return false;
- pPathObj->m_Path.AppendPoint(CFX_PointF(x1, y1), FXPT_TYPE::BezierTo, false);
- pPathObj->m_Path.AppendPoint(CFX_PointF(x2, y2), FXPT_TYPE::BezierTo, false);
- pPathObj->m_Path.AppendPoint(CFX_PointF(x3, y3), FXPT_TYPE::BezierTo, false);
+ CPDF_Path& cpath = pPathObj->path();
+ cpath.AppendPoint(CFX_PointF(x1, y1), FXPT_TYPE::BezierTo, false);
+ cpath.AppendPoint(CFX_PointF(x2, y2), FXPT_TYPE::BezierTo, false);
+ cpath.AppendPoint(CFX_PointF(x3, y3), FXPT_TYPE::BezierTo, false);
pPathObj->SetDirty(true);
return true;
}
@@ -194,10 +195,11 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_Close(FPDF_PAGEOBJECT path) {
if (!pPathObj)
return false;
- if (pPathObj->m_Path.GetPoints().empty())
+ CPDF_Path& cpath = pPathObj->path();
+ if (cpath.GetPoints().empty())
return false;
- pPathObj->m_Path.ClosePath();
+ cpath.ClosePath();
pPathObj->SetDirty(true);
return true;
}
@@ -209,13 +211,13 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path,
if (!pPathObj)
return false;
+ pPathObj->set_stroke(!!stroke);
if (fillmode == FPDF_FILLMODE_ALTERNATE)
pPathObj->set_filltype(FXFILL_ALTERNATE);
else if (fillmode == FPDF_FILLMODE_WINDING)
pPathObj->set_filltype(FXFILL_WINDING);
else
pPathObj->set_filltype(0);
- pPathObj->set_stroke(!!stroke);
pPathObj->SetDirty(true);
return true;
}