diff options
author | wileyrya <wileyrr@gmail.com> | 2017-05-26 09:26:27 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-05-26 16:16:52 +0000 |
commit | 22a237fb403d76d65a254c4f9cf1c1a9d0b22772 (patch) | |
tree | ae2888307c024ece316778b3cc7fedca8f4f658a /fpdfsdk/fpdfeditpath.cpp | |
parent | 1bbcb35e4e5593998837c832eabf16a91a695387 (diff) | |
download | pdfium-22a237fb403d76d65a254c4f9cf1c1a9d0b22772.tar.xz |
Add public API for setting LineJoin and LineCap on a path
BUG=pdfium:718
R=npm@chromium.org
Change-Id: Icdc1546c87a676a7d05330dece2c5eacd92c0c92
Reviewed-on: https://pdfium-review.googlesource.com/5951
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfeditpath.cpp')
-rw-r--r-- | fpdfsdk/fpdfeditpath.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfeditpath.cpp b/fpdfsdk/fpdfeditpath.cpp index 60117cad32..54937ef91a 100644 --- a/fpdfsdk/fpdfeditpath.cpp +++ b/fpdfsdk/fpdfeditpath.cpp @@ -149,3 +149,32 @@ DLLEXPORT FPDF_BOOL FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path, pPathObj->m_bStroke = stroke != 0; return true; } + +DLLEXPORT void STDCALL FPDFPath_SetLineJoin(FPDF_PAGEOBJECT path, + int line_join) { + if (!path) + return; + if (line_join < + static_cast<int>(CFX_GraphStateData::LineJoin::LineJoinMiter) || + line_join > + static_cast<int>(CFX_GraphStateData::LineJoin::LineJoinBevel)) { + return; + } + auto* pPathObj = static_cast<CPDF_PageObject*>(path); + CFX_GraphStateData::LineJoin lineJoin = + static_cast<CFX_GraphStateData::LineJoin>(line_join); + pPathObj->m_GraphState.SetLineJoin(lineJoin); +} + +DLLEXPORT void STDCALL FPDFPath_SetLineCap(FPDF_PAGEOBJECT path, int line_cap) { + if (!path) + return; + if (line_cap < static_cast<int>(CFX_GraphStateData::LineCap::LineCapButt) || + line_cap > static_cast<int>(CFX_GraphStateData::LineCap::LineCapSquare)) { + return; + } + auto* pPathObj = static_cast<CPDF_PageObject*>(path); + CFX_GraphStateData::LineCap lineCap = + static_cast<CFX_GraphStateData::LineCap>(line_cap); + pPathObj->m_GraphState.SetLineCap(lineCap); +} |