diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-09-15 07:49:03 +0200 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-15 06:03:35 +0000 |
commit | 12abfd04a42a1166f7d1496beb63515bc47ec360 (patch) | |
tree | 573057f4cf24780bdf17d2ac113e48eec0897780 /fpdfsdk/fpdfeditpath.cpp | |
parent | 69fe7110e6af83ca82d71275a70ae4983daddd6f (diff) | |
download | pdfium-12abfd04a42a1166f7d1496beb63515bc47ec360.tar.xz |
Add public method FPDFPath_CountPoint to get # of points of a path object.
It was already possible to get the fill color, this exposes the number of
points. Naming attempts to be consistent with existing
FPDFPage_CountObject().
Change-Id: I79e8dd9f0c077de84ce9017a01d239e48e58174a
Reviewed-on: https://pdfium-review.googlesource.com/13592
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfeditpath.cpp')
-rw-r--r-- | fpdfsdk/fpdfeditpath.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfeditpath.cpp b/fpdfsdk/fpdfeditpath.cpp index 2b33dee934..164ab7015f 100644 --- a/fpdfsdk/fpdfeditpath.cpp +++ b/fpdfsdk/fpdfeditpath.cpp @@ -118,6 +118,13 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_GetFillColor(FPDF_PAGEOBJECT path, return true; } +FPDF_EXPORT int FPDF_CALLCONV FPDFPath_CountPoint(FPDF_PAGEOBJECT path) { + auto* pPathObj = CPDFPathObjectFromFPDFPageObject(path); + if (!pPathObj) + return -1; + return pdfium::CollectionSize<int>(pPathObj->m_Path.GetPoints()); +} + FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_MoveTo(FPDF_PAGEOBJECT path, float x, float y) { |