summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfeditpath.cpp
diff options
context:
space:
mode:
authorwileyrya <wileyrr@gmail.com>2017-05-26 11:38:14 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-05-26 17:20:01 +0000
commit864e9fb67f42186ce24d9bf09e643c85ff89a175 (patch)
tree47812402bb4e75d02ff62da3470447fbde12d940 /fpdfsdk/fpdfeditpath.cpp
parent22a237fb403d76d65a254c4f9cf1c1a9d0b22772 (diff)
downloadpdfium-864e9fb67f42186ce24d9bf09e643c85ff89a175.tar.xz
Add public API for setting the fill color on a text object
BUG=pdfium:719 R=npm@chromium.org Change-Id: Ifd9330de265f8419d588b65fbd6a6187f17badd1 Reviewed-on: https://pdfium-review.googlesource.com/5950 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.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/fpdfsdk/fpdfeditpath.cpp b/fpdfsdk/fpdfeditpath.cpp
index 54937ef91a..ad5ca9433f 100644
--- a/fpdfsdk/fpdfeditpath.cpp
+++ b/fpdfsdk/fpdfeditpath.cpp
@@ -7,6 +7,7 @@
#include "core/fpdfapi/page/cpdf_path.h"
#include "core/fpdfapi/page/cpdf_pathobject.h"
#include "core/fxcrt/fx_system.h"
+#include "fpdfsdk/fsdk_define.h"
#include "third_party/base/ptr_util.h"
DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_CreateNewPath(float x, float y) {
@@ -56,15 +57,7 @@ DLLEXPORT FPDF_BOOL FPDFPath_SetFillColor(FPDF_PAGEOBJECT path,
unsigned int G,
unsigned int B,
unsigned int A) {
- if (!path || R > 255 || G > 255 || B > 255 || A > 255)
- return false;
-
- float rgb[3] = {R / 255.f, G / 255.f, B / 255.f};
- auto* pPathObj = static_cast<CPDF_PathObject*>(path);
- pPathObj->m_GeneralState.SetFillAlpha(A / 255.f);
- pPathObj->m_ColorState.SetFillColor(
- CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
- return true;
+ return FPDFPageObj_SetFillColor(path, R, G, B, A);
}
DLLEXPORT FPDF_BOOL FPDFPath_GetFillColor(FPDF_PAGEOBJECT path,