diff options
Diffstat (limited to 'fpdfsdk/pdfwindow/PWL_Icon.cpp')
-rw-r--r-- | fpdfsdk/pdfwindow/PWL_Icon.cpp | 16 |
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; } |