summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_baannot.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-14 14:43:42 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-14 19:05:58 +0000
commit05df075154a832fcb476e1dfcfb865722d0ea898 (patch)
treeb8b771b62adae74d5d5ee561db75d10de3a848bf /fpdfsdk/cpdfsdk_baannot.cpp
parent6b94f01d1c8ad386d497428c7397b1a99614aeba (diff)
downloadpdfium-05df075154a832fcb476e1dfcfb865722d0ea898.tar.xz
Replace FX_FLOAT with underlying float type.
Change-Id: I158b7d80b0ec28b742a9f2d5a96f3dde7fb3ab56 Reviewed-on: https://pdfium-review.googlesource.com/3031 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/cpdfsdk_baannot.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_baannot.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/fpdfsdk/cpdfsdk_baannot.cpp b/fpdfsdk/cpdfsdk_baannot.cpp
index 3c96550a42..129491c210 100644
--- a/fpdfsdk/cpdfsdk_baannot.cpp
+++ b/fpdfsdk/cpdfsdk_baannot.cpp
@@ -245,11 +245,11 @@ BorderStyle CPDFSDK_BAAnnot::GetBorderStyle() const {
void CPDFSDK_BAAnnot::SetColor(FX_COLORREF color) {
CPDF_Array* pArray = m_pAnnot->GetAnnotDict()->SetNewFor<CPDF_Array>("C");
- pArray->AddNew<CPDF_Number>(static_cast<FX_FLOAT>(FXSYS_GetRValue(color)) /
+ pArray->AddNew<CPDF_Number>(static_cast<float>(FXSYS_GetRValue(color)) /
255.0f);
- pArray->AddNew<CPDF_Number>(static_cast<FX_FLOAT>(FXSYS_GetGValue(color)) /
+ pArray->AddNew<CPDF_Number>(static_cast<float>(FXSYS_GetGValue(color)) /
255.0f);
- pArray->AddNew<CPDF_Number>(static_cast<FX_FLOAT>(FXSYS_GetBValue(color)) /
+ pArray->AddNew<CPDF_Number>(static_cast<float>(FXSYS_GetBValue(color)) /
255.0f);
}
@@ -261,28 +261,28 @@ bool CPDFSDK_BAAnnot::GetColor(FX_COLORREF& color) const {
if (CPDF_Array* pEntry = m_pAnnot->GetAnnotDict()->GetArrayFor("C")) {
size_t nCount = pEntry->GetCount();
if (nCount == 1) {
- FX_FLOAT g = pEntry->GetNumberAt(0) * 255;
+ float g = pEntry->GetNumberAt(0) * 255;
color = FXSYS_RGB((int)g, (int)g, (int)g);
return true;
} else if (nCount == 3) {
- FX_FLOAT r = pEntry->GetNumberAt(0) * 255;
- FX_FLOAT g = pEntry->GetNumberAt(1) * 255;
- FX_FLOAT b = pEntry->GetNumberAt(2) * 255;
+ float r = pEntry->GetNumberAt(0) * 255;
+ float g = pEntry->GetNumberAt(1) * 255;
+ float b = pEntry->GetNumberAt(2) * 255;
color = FXSYS_RGB((int)r, (int)g, (int)b);
return true;
} else if (nCount == 4) {
- FX_FLOAT c = pEntry->GetNumberAt(0);
- FX_FLOAT m = pEntry->GetNumberAt(1);
- FX_FLOAT y = pEntry->GetNumberAt(2);
- FX_FLOAT k = pEntry->GetNumberAt(3);
-
- FX_FLOAT r = 1.0f - std::min(1.0f, c + k);
- FX_FLOAT g = 1.0f - std::min(1.0f, m + k);
- FX_FLOAT b = 1.0f - std::min(1.0f, y + k);
+ float c = pEntry->GetNumberAt(0);
+ float m = pEntry->GetNumberAt(1);
+ float y = pEntry->GetNumberAt(2);
+ float k = pEntry->GetNumberAt(3);
+
+ float r = 1.0f - std::min(1.0f, c + k);
+ float g = 1.0f - std::min(1.0f, m + k);
+ float b = 1.0f - std::min(1.0f, y + k);
color = FXSYS_RGB((int)(r * 255), (int)(g * 255), (int)(b * 255));