summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/PWL_Icon.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-14 15:42:11 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-14 21:20:37 +0000
commit5f2d381028b2c09bd09a843368328155b1399c5e (patch)
tree39f0accddf4ba23fdff3f06c4b953137a4b68e36 /fpdfsdk/pdfwindow/PWL_Icon.cpp
parent7d4ccd7b5dd9ebb14e97ad35fb3bc093225b939a (diff)
downloadpdfium-5f2d381028b2c09bd09a843368328155b1399c5e.tar.xz
Replace CPWL_Point with CFX_PointFchromium/3013
The CPWL_Point is a subclass of CFX_PointF but adds no behaviour. Replacing with parent class. Change-Id: I5b971eb455a19c1e2bfebde86e4c8e2132bc62ad Reviewed-on: https://pdfium-review.googlesource.com/2654 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/pdfwindow/PWL_Icon.cpp')
-rw-r--r--fpdfsdk/pdfwindow/PWL_Icon.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_Icon.cpp b/fpdfsdk/pdfwindow/PWL_Icon.cpp
index 4abe884156..b0d0c7686d 100644
--- a/fpdfsdk/pdfwindow/PWL_Icon.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Icon.cpp
@@ -6,6 +6,8 @@
#include "fpdfsdk/pdfwindow/PWL_Icon.h"
+#include <algorithm>
+
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "fpdfsdk/pdfwindow/PWL_Utils.h"
@@ -169,20 +171,20 @@ void CPWL_Icon::GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) {
switch (nScaleMethod) {
default:
case 0:
- fHScale = fPlateWidth / PWL_MAX(fImageWidth, 1.0f);
- fVScale = fPlateHeight / PWL_MAX(fImageHeight, 1.0f);
+ fHScale = fPlateWidth / std::max(fImageWidth, 1.0f);
+ fVScale = fPlateHeight / std::max(fImageHeight, 1.0f);
break;
case 1:
if (fPlateWidth < fImageWidth)
- fHScale = fPlateWidth / PWL_MAX(fImageWidth, 1.0f);
+ fHScale = fPlateWidth / std::max(fImageWidth, 1.0f);
if (fPlateHeight < fImageHeight)
- fVScale = fPlateHeight / PWL_MAX(fImageHeight, 1.0f);
+ fVScale = fPlateHeight / std::max(fImageHeight, 1.0f);
break;
case 2:
if (fPlateWidth > fImageWidth)
- fHScale = fPlateWidth / PWL_MAX(fImageWidth, 1.0f);
+ fHScale = fPlateWidth / std::max(fImageWidth, 1.0f);
if (fPlateHeight > fImageHeight)
- fVScale = fPlateHeight / PWL_MAX(fImageHeight, 1.0f);
+ fVScale = fPlateHeight / std::max(fImageHeight, 1.0f);
break;
case 3:
break;
@@ -190,7 +192,7 @@ void CPWL_Icon::GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) {
FX_FLOAT fMinScale;
if (IsProportionalScale()) {
- fMinScale = PWL_MIN(fHScale, fVScale);
+ fMinScale = std::min(fHScale, fVScale);
fHScale = fMinScale;
fVScale = fMinScale;
}