From 85f019a8e7d33cbba368a6c6b75fd091269e14a1 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 17 Mar 2017 15:14:19 -0700 Subject: Add pdfium::clamp() as a placeholder for std::clamp(). Ue it to fix a typo as well. BUG=pdfium:634 Change-Id: I2d686242ffb841aedc2fae6a3cf7a00bea667404 Reviewed-on: https://pdfium-review.googlesource.com/3113 Commit-Queue: Lei Zhang Reviewed-by: Tom Sepez --- core/fxge/agg/fx_agg_driver.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/fxge/agg') diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp index 4534ee1425..b435c032bc 100644 --- a/core/fxge/agg/fx_agg_driver.cpp +++ b/core/fxge/agg/fx_agg_driver.cpp @@ -24,14 +24,15 @@ #include "third_party/agg23/agg_renderer_scanline.h" #include "third_party/agg23/agg_scanline_u.h" #include "third_party/base/ptr_util.h" +#include "third_party/base/stl_util.h" namespace { const float kMaxPos = 32000.0f; CFX_PointF HardClip(const CFX_PointF& pos) { - return CFX_PointF(std::max(std::min(pos.x, kMaxPos), -kMaxPos), - std::max(std::min(pos.y, kMaxPos), -kMaxPos)); + return CFX_PointF(pdfium::clamp(pos.x, -kMaxPos, kMaxPos), + pdfium::clamp(pos.y, -kMaxPos, kMaxPos)); } void RgbByteOrderSetPixel(CFX_DIBitmap* pBitmap, int x, int y, uint32_t argb) { -- cgit v1.2.3